scd: Distinguish cancel by user and protocol error.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 20 Sep 2017 01:06:43 +0000 (10:06 +0900)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 30 Aug 2018 15:57:15 +0000 (16:57 +0100)
commit80e9417cc2d4af1ecb3e162836d934c4a83e84fd
treefed9a0e99576a14a6a4f11e14cc1438dc3c62bcd
parent30a27b7855f366decd213286160870b0db5aa0e5
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 <gniibe@fsij.org>
(cherry picked from commit 2396055c096884d521c26b76f26263a146207c24)

Gbp-Pq: Topic from-master
Gbp-Pq: Name scd-Distinguish-cancel-by-user-and-protocol-error.patch
scd/apdu.c
scd/apdu.h
scd/iso7816.c