diff options
Diffstat (limited to '')
-rw-r--r-- | scd/iso7816.c | 51 |
1 files changed, 7 insertions, 44 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c index 8876b931a..45f5e08bf 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -307,16 +307,18 @@ iso7816_verify (int slot, int chvno, const char *chv, size_t chvlen) /* Perform a CHANGE_REFERENCE_DATA command on SLOT for the card holder verification vector CHVNO. With PININFO non-NULL the keypad of the - reader will be used. */ + reader will be used. If IS_EXCHANGE is 0, a "change reference + data" is done, otherwise an "exchange reference data". */ gpg_error_t -iso7816_change_reference_data_kp (int slot, int chvno, +iso7816_change_reference_data_kp (int slot, int chvno, int is_exchange, iso7816_pininfo_t *pininfo) { int sw; - sw = apdu_keypad_modify (slot, 0x00, CMD_CHANGE_REFERENCE_DATA, 0, chvno, - pininfo->mode, pininfo->minlen, pininfo->maxlen, - pininfo->padlen); + sw = apdu_keypad_modify (slot, 0x00, CMD_CHANGE_REFERENCE_DATA, + is_exchange ? 1 : 0, + chvno, pininfo->mode, pininfo->minlen, + pininfo->maxlen, pininfo->padlen); return map_sw (sw); } @@ -354,19 +356,6 @@ iso7816_change_reference_data (int slot, int chvno, gpg_error_t -iso7816_reset_retry_counter_with_rc_kp (int slot, int chvno, - iso7816_pininfo_t *pininfo) -{ - int sw; - - sw = apdu_keypad_modify (slot, 0x00, CMD_RESET_RETRY_COUNTER, 0, chvno, - pininfo->mode, pininfo->minlen, pininfo->maxlen, - pininfo->padlen); - return map_sw (sw); -} - - -gpg_error_t iso7816_reset_retry_counter_with_rc (int slot, int chvno, const char *data, size_t datalen) { @@ -382,19 +371,6 @@ iso7816_reset_retry_counter_with_rc (int slot, int chvno, gpg_error_t -iso7816_reset_retry_counter_kp (int slot, int chvno, - iso7816_pininfo_t *pininfo) -{ - int sw; - - sw = apdu_keypad_modify (slot, 0x00, CMD_RESET_RETRY_COUNTER, 2, chvno, - pininfo->mode, pininfo->minlen, pininfo->maxlen, - pininfo->padlen); - return map_sw (sw); -} - - -gpg_error_t iso7816_reset_retry_counter (int slot, int chvno, const char *newchv, size_t newchvlen) { @@ -445,19 +421,6 @@ iso7816_get_data (int slot, int extended_mode, int tag, } -gpg_error_t -iso7816_put_data_kp (int slot, int tag, iso7816_pininfo_t *pininfo) -{ - int sw; - - sw = apdu_keypad_modify (slot, 0x00, CMD_PUT_DATA, - ((tag >> 8) & 0xff), (tag & 0xff), - pininfo->mode, pininfo->minlen, pininfo->maxlen, - pininfo->padlen); - return map_sw (sw); -} - - /* Perform a PUT DATA command on card in SLOT. Write DATA of length DATALEN to TAG. EXTENDED_MODE controls whether extended length headers or command chaining is used instead of single length |