avoid debugging PIN commands
use a higher debug level to see it anyway
This commit is contained in:
parent
9681193ad5
commit
d06f23e89b
@ -37,6 +37,7 @@ enum {
|
||||
SC_LOG_DEBUG_SM, /* secure messaging */
|
||||
SC_LOG_DEBUG_ASN1, /* asn1.c */
|
||||
SC_LOG_DEBUG_MATCH, /* card matching */
|
||||
SC_LOG_DEBUG_PIN, /* PIN commands */
|
||||
};
|
||||
|
||||
#define SC_COLOR_FG_RED 0x0001
|
||||
|
@ -192,12 +192,19 @@ int sc_reset_retry_counter(sc_card_t *card, unsigned int type, int ref,
|
||||
int sc_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
|
||||
int *tries_left)
|
||||
{
|
||||
int r;
|
||||
int r, debug;
|
||||
|
||||
if (card == NULL) {
|
||||
return SC_ERROR_INVALID_ARGUMENTS;
|
||||
}
|
||||
LOG_FUNC_CALLED(card->ctx);
|
||||
|
||||
debug = card->ctx->debug;
|
||||
if (data->cmd != SC_PIN_CMD_GET_INFO
|
||||
&& card->ctx->debug < SC_LOG_DEBUG_PIN) {
|
||||
card->ctx->debug = 0;
|
||||
}
|
||||
|
||||
if (card->ops->pin_cmd) {
|
||||
r = card->ops->pin_cmd(card, data, tries_left);
|
||||
} else if (!(data->flags & SC_PIN_CMD_USE_PINPAD)) {
|
||||
@ -244,6 +251,8 @@ int sc_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
|
||||
sc_log(card->ctx, "Use of pin pad not supported by card driver");
|
||||
r = SC_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
card->ctx->debug = debug;
|
||||
|
||||
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, r);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user