[pkg-opensc-commit] [opensc] 123/295: cwa-14890: force to re-establish the SM when disconnected by another process.

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit e6dca4916922cbc7f5fe68dd5155cb5bfd6f0ff3
Author: ricky <rickyepoderi at yahoo.es>
Date:   Sun Oct 23 11:40:07 2016 +0200

    cwa-14890: force to re-establish the SM when disconnected by another process.
---
 src/libopensc/cwa14890.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libopensc/cwa14890.c b/src/libopensc/cwa14890.c
index 624cbbc..1cc9d49 100644
--- a/src/libopensc/cwa14890.c
+++ b/src/libopensc/cwa14890.c
@@ -1665,8 +1665,11 @@ int cwa_decode_response(sc_card_t * card,
 	/* cwa14890 sect 9.3: check SW1 or SW2 for SM related errors */
 	if (apdu->sw1 == 0x69) {
 		if ((apdu->sw2 == 0x88) || (apdu->sw2 == 0x87)) {
+			/* configure the driver to re-establish the SM */
 			msg = "SM related errors in APDU response";
-			res = SC_ERROR_SM_ENCRYPT_FAILED;	/* tell driver to restart SM */
+			sm_session->state = CWA_SM_NONE;
+			card->sm_ctx.sm_mode = SM_MODE_NONE;
+			res = SC_ERROR_SECURITY_STATUS_NOT_SATISFIED;
 			goto response_decode_end;
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list