diff options
author | Werner Koch <[email protected]> | 2023-11-17 13:40:38 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-11-21 07:35:01 +0000 |
commit | e43bd2a7a7831a2d23fb9aa06b913f17dad89478 (patch) | |
tree | a3830e7c6120765f9ef4ecbf9b41c340ebfaab7c /scd/apdu.c | |
parent | po: Update Japanese Translation. (diff) | |
download | gnupg-e43bd2a7a7831a2d23fb9aa06b913f17dad89478.tar.gz gnupg-e43bd2a7a7831a2d23fb9aa06b913f17dad89478.zip |
scd: New option --debug-allow-pin-logging.
* scd/scdaemon.c (oDebugAllowPINLogging): New.
(opts): Add option.
(main): Set option.
* scd/scdaemon.h (opt): Add debug_allow_pin_logging.
* scd/apdu.c (pcsc_send_apdu): Do not hide the PIN dat in the debug
output if the option is set.
(send_apdu_ccid): Ditto.
--
This option is only required during development.
Diffstat (limited to 'scd/apdu.c')
-rw-r--r-- | scd/apdu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index 7f3c320d2..98158648b 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -775,8 +775,8 @@ pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen, if (DBG_CARD_IO) { /* Do not dump the PIN in a VERIFY command. */ - if (apdulen > 5 && apdu[1] == 0x20) - log_debug ("PCSC_data: %02X %02X %02X %02X %02X [redacted]\n", + if (apdulen > 5 && apdu[1] == 0x20 && !opt.debug_allow_pin_logging) + log_debug ("PCSC_data: %02X %02X %02X %02X %02X [hidden]\n", apdu[0], apdu[1], apdu[2], apdu[3], apdu[4]); else log_printhex (apdu, apdulen, "PCSC_data:"); @@ -1564,8 +1564,8 @@ send_apdu_ccid (int slot, unsigned char *apdu, size_t apdulen, if (DBG_CARD_IO) { /* Do not dump the PIN in a VERIFY command. */ - if (apdulen > 5 && apdu[1] == 0x20) - log_debug (" raw apdu: %02x%02x%02x%02x%02x [redacted]\n", + if (apdulen > 5 && apdu[1] == 0x20 && !opt.debug_allow_pin_logging) + log_debug (" raw apdu: %02x%02x%02x%02x%02x [hidden]\n", apdu[0], apdu[1], apdu[2], apdu[3], apdu[4]); else log_printhex (apdu, apdulen, " raw apdu:"); |