scd: PC/SC pinpad support. (Backported from master.)
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 28 Nov 2011 07:16:38 +0000 (16:16 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 25 Jun 2012 01:04:22 +0000 (10:04 +0900)
commitc2525d507d802e43861f3361ff58be4f41da27df
tree1c883a69186b29ccf3f3cc1f2387ebc094bd8a4a
parentae80f83611757b0a609d891c8f47d00ff1efa2a4
scd: PC/SC pinpad support.  (Backported from )

* iso7816.h (iso7816_verify_kp): Remove arguments of CHV and CHVLEN.

* iso7816.c (iso7816_verify_kp): Call apdu_keypad_verify. Only
handle thecase with PININFO.
(iso7816_verify): Call apdu_send_simple.

* app-openpgp.c (verify_a_chv, verify_chv3): Follow the change of
iso7816_verify_kp.

* app-nks.c (verify_pin): Likewise.

* app-dinsig.c (verify_pin): Likewise.

* apdu.c: Include "iso7816.h".
(struct reader_table_s): New memeber function keypad_verify.
Add fields verify_ioctl and modify_ioctl in pcsc.
(CM_IOCTL_GET_FEATURE_REQUEST, FEATURE_VERIFY_PIN_DIRECT)
(FEATURE_MODIFY_PIN_DIRECT): New.
(pcsc_control): New.
(control_pcsc_direct, control_pcsc_wrapped, control_pcsc)
(check_pcsc_keypad, pcsc_keypad_verify): New.
(ccid_keypad_verify, apdu_keypad_verify): New.
(new_reader_slot): Initialize with check_pcsc_keypad,
pcsc_keypad_verify, verify_ioctl and modify_ioctl.
(open_ct_reader): Initialize keypad_verify with NULL.
(open_ccid_reader): Initialize keypad_verify.
(open_rapdu_reader): Initialize keypad_verify with NULL.
(apdu_open_reader): Initialize pcsc_control.

* pcsc-wrapper.c (load_pcsc_driver): Initialize pcsc_control.
(handle_control): New.
(main): Handle the case 6 of handle_control.
scd/apdu.c
scd/apdu.h
scd/app-dinsig.c
scd/app-nks.c
scd/app-openpgp.c
scd/iso7816.c
scd/iso7816.h
scd/pcsc-wrapper.c