diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2011-11-28 08:16:38 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2011-11-28 08:16:38 +0100 |
commit | 26b4a012e3eb3a6ce79a1e53f7cdfbbdf8c8e8f5 (patch) | |
tree | aac121767d2bcf7d987ee412d75ce1184d7fe005 /scd/iso7816.c | |
parent | Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gnupg (diff) | |
download | gnupg2-26b4a012e3eb3a6ce79a1e53f7cdfbbdf8c8e8f5.tar.xz gnupg2-26b4a012e3eb3a6ce79a1e53f7cdfbbdf8c8e8f5.zip |
PC/SC pinpad support.
Before this change, it is layered like following:
iso7816_verify
iso7816_verify_kp
apdu_send_simple, apdu_send_simple_kp
...
After this change, it will be layered like:
iso7816_verify iso7816_verify_kp
apdu_send_simple apdu_keypad_verify
...
and apdu_send_simple_kp will be deprecated.
For PC/SC API, we use:
SCardControl API to compose CCID PC_to_RDR_Secure message
SCardTransmit API to compose CCID PC_to_RDR_XfrBlock message
Considering the support of PC/SC, we have nothing to share between _kp
version of iso7816_* and no _kp version.
Diffstat (limited to 'scd/iso7816.c')
-rw-r--r-- | scd/iso7816.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c index 318fec8a2..1238552f6 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -281,22 +281,16 @@ iso7816_check_keypad (int slot, int command, iso7816_pininfo_t *pininfo) /* Perform a VERIFY command on SLOT using the card holder verification - vector CHVNO with a CHV of lenght CHVLEN. With PININFO non-NULL - the keypad of the reader will be used. Returns 0 on success. */ + vector CHVNO. With PININFO non-NULL the keypad of the reader will + be used. Returns 0 on success. */ gpg_error_t -iso7816_verify_kp (int slot, int chvno, const char *chv, size_t chvlen, - iso7816_pininfo_t *pininfo) +iso7816_verify_kp (int slot, int chvno, iso7816_pininfo_t *pininfo) { int sw; - if (pininfo && pininfo->mode) - sw = apdu_send_simple_kp (slot, 0x00, CMD_VERIFY, 0, chvno, chvlen, chv, - pininfo->mode, - pininfo->minlen, - pininfo->maxlen, - pininfo->padlen); - else - sw = apdu_send_simple (slot, 0, 0x00, CMD_VERIFY, 0, chvno, chvlen, chv); + sw = apdu_keypad_verify (slot, 0x00, CMD_VERIFY, 0, chvno, + pininfo->mode, pininfo->minlen, pininfo->maxlen, + pininfo->padlen); return map_sw (sw); } @@ -305,7 +299,10 @@ iso7816_verify_kp (int slot, int chvno, const char *chv, size_t chvlen, gpg_error_t iso7816_verify (int slot, int chvno, const char *chv, size_t chvlen) { - return iso7816_verify_kp (slot, chvno, chv, chvlen, NULL); + int sw; + + sw = apdu_send_simple (slot, 0, 0x00, CMD_VERIFY, 0, chvno, chvlen, chv); + return map_sw (sw); } /* Perform a CHANGE_REFERENCE_DATA command on SLOT for the card holder |