aboutsummaryrefslogtreecommitdiffstats
path: root/scd/iso7816.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2017-09-20 01:06:43 +0000
committerNIIBE Yutaka <[email protected]>2017-09-20 01:06:43 +0000
commit2396055c096884d521c26b76f26263a146207c24 (patch)
tree08782084a7bf005b1774723b00a20aa15e609da3 /scd/iso7816.c
parentcommon: Accept the Z-suffix for yymmddThhmmssZ format. (diff)
downloadgnupg-2396055c096884d521c26b76f26263a146207c24.tar.gz
gnupg-2396055c096884d521c26b76f26263a146207c24.zip
scd: Distinguish cancel by user and protocol error.
* scd/apdu.h (SW_HOST_CANCELLED): New. * scd/apdu.c (host_sw_string): Support SW_HOST_CANCELLED. (pcsc_error_to_sw): Return SW_HOST_CANCELLED for PCSC_E_CANCELLED. * scd/iso7816.c (map_sw): Return GPG_ERR_INV_RESPONSE for SW_HOST_ABORTED and GPG_ERR_CANCELED for SW_HOST_CANCELLED. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/iso7816.c')
-rw-r--r--scd/iso7816.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c
index 081b0808c..29208c254 100644
--- a/scd/iso7816.c
+++ b/scd/iso7816.c
@@ -93,8 +93,9 @@ map_sw (int sw)
case SW_HOST_CARD_IO_ERROR: ec = GPG_ERR_EIO; break;
case SW_HOST_GENERAL_ERROR: ec = GPG_ERR_GENERAL; break;
case SW_HOST_NO_READER: ec = GPG_ERR_ENODEV; break;
- case SW_HOST_ABORTED: ec = GPG_ERR_CANCELED; break;
+ case SW_HOST_ABORTED: ec = GPG_ERR_INV_RESPONSE; break;
case SW_HOST_NO_PINPAD: ec = GPG_ERR_NOT_SUPPORTED; break;
+ case SW_HOST_CANCELLED: ec = GPG_ERR_CANCELED; break;
default:
if ((sw & 0x010000))