This patch implements sc_logout() in AKIS card driver, and fixes two typos in 
other files.
Index: src/pkcs11/framework-pkcs15.c
===================================================================
--- src/pkcs11/framework-pkcs15.c	(revision 3258)
+++ src/pkcs11/framework-pkcs15.c	(working copy)
@@ -618,7 +618,7 @@
 	obj->refcount++;
 
 	if (obj->p15_object && (obj->p15_object->user_consent > 0) ) {
-		sc_debug(context, "User consent object deteced, marking slot as user_consent!\n");
+		sc_debug(context, "User consent object detected, marking slot as user_consent!\n");
 		((struct pkcs15_slot_data *)slot->fw_data)->user_consent = 1;
 	}
 
Index: src/libopensc/card-akis.c
===================================================================
--- src/libopensc/card-akis.c	(revision 3258)
+++ src/libopensc/card-akis.c	(working copy)
@@ -476,6 +476,20 @@
 	return SC_SUCCESS;
 }
 
+static int
+akis_logout(sc_card_t *card)
+{
+	int r;
+	sc_apdu_t apdu;
+
+	sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0x1A, 0, 0);
+	apdu.cla = 0x80;
+	r = sc_transmit_apdu(card, &apdu);
+	SC_TEST_RET(card->ctx, r, "APDU transmit failed");
+	r = sc_check_sw(card, apdu.sw1, apdu.sw2);
+	return r;
+}
+
 static struct sc_card_driver *
 sc_get_driver(void)
 {
@@ -497,6 +511,7 @@
 	akis_ops.select_file = akis_select_file;
 	// get_response: ISO7816 implementation works
 	// get_challenge: ISO7816 implementation works
+	akis_ops.logout = akis_logout;
 	// restore_security_env: Untested
 	akis_ops.set_security_env = akis_set_security_env;
 	// decipher: Untested
Index: src/libopensc/apdu.c
===================================================================
--- src/libopensc/apdu.c	(revision 3258)
+++ src/libopensc/apdu.c	(working copy)
@@ -396,7 +396,7 @@
 	}
 	/* ok, the APDU was successfully transmitted. Now we have two
 	 * special cases:
-	 * 1. the card returnd 0x6Cxx: in this case we re-trasmit the APDU
+	 * 1. the card returned 0x6Cxx: in this case we re-trasmit the APDU
 	 *    wit hLe set to SW2 (this is course only possible if the
 	 *    response buffer size is larger than the new Le = SW2)
 	 */
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to