diff options
author | NIIBE Yutaka <[email protected]> | 2013-01-11 02:26:16 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2013-01-11 02:30:57 +0000 |
commit | ff4f9ea82f045b27ccdf36564bc8a9a83641dcb2 (patch) | |
tree | 2a2f8ae6f0d5ee5ab996884266d594ea4aff40c7 | |
parent | SCD: Defaults to use pinpad if the reader has the capability. (diff) | |
parent | SCD: Hold lock for pinpad input. (diff) | |
download | gnupg-ff4f9ea82f045b27ccdf36564bc8a9a83641dcb2.tar.gz gnupg-ff4f9ea82f045b27ccdf36564bc8a9a83641dcb2.zip |
Merge branch 'scd-serialize-bugfix' into scd-work
Conflicts:
scd/apdu.c
-rw-r--r-- | scd/apdu.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index 4c73283fb..f78463ae2 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -3404,7 +3404,16 @@ apdu_check_keypad (int slot, int command, pininfo_t *pininfo) pininfo->fixedlen = 0; if (reader_table[slot].check_keypad) - return reader_table[slot].check_keypad (slot, command, pininfo); + { + int sw; + + if ((sw = lock_slot (slot))) + return sw; + + sw = reader_table[slot].check_keypad (slot, command, pininfo); + unlock_slot (slot); + return sw; + } else return SW_HOST_NOT_SUPPORTED; } @@ -3418,8 +3427,17 @@ apdu_keypad_verify (int slot, int class, int ins, int p0, int p1, return SW_HOST_NO_DRIVER; if (reader_table[slot].keypad_verify) - return reader_table[slot].keypad_verify (slot, class, ins, p0, p1, - pininfo); + { + int sw; + + if ((sw = lock_slot (slot))) + return sw; + + sw = reader_table[slot].keypad_verify (slot, class, ins, p0, p1, + pininfo); + unlock_slot (slot); + return sw; + } else return SW_HOST_NOT_SUPPORTED; } @@ -3433,8 +3451,17 @@ apdu_keypad_modify (int slot, int class, int ins, int p0, int p1, return SW_HOST_NO_DRIVER; if (reader_table[slot].keypad_modify) - return reader_table[slot].keypad_modify (slot, class, ins, p0, p1, + { + int sw; + + if ((sw = lock_slot (slot))) + return sw; + + sw = reader_table[slot].keypad_modify (slot, class, ins, p0, p1, pininfo); + unlock_slot (slot); + return sw; + } else return SW_HOST_NOT_SUPPORTED; } |