[pkg-opensc-commit] [opensc] 12/23: fix NEWS, few debug messages more

Eric Dorland eric at moszumanska.debian.org
Tue Jul 5 06:01:12 UTC 2016


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

eric pushed a commit to branch master
in repository opensc.

commit 1da49757cb2fd2b59c50c4f67107445d20a62430
Author: Viktor Tarasov <viktor.tarasov at gmail.com>
Date:   Thu May 26 10:59:58 2016 +0200

    fix NEWS, few debug messages more
---
 NEWS                    |  2 --
 src/libopensc/iso7816.c | 13 ++++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index 5bbb511..cc57e98 100644
--- a/NEWS
+++ b/NEWS
@@ -45,8 +45,6 @@ New in 0.16.0; 2016-05-15
   cache of on-card files extended to application paths
   configuration option to enable/disable application
   make file cache dir configurable
-  partial parse of 'security condition' -- take auth.id of protecting object
-      from 'security condition'
   in key info data type introduced 'auxiliary data' -- container
       for the non-pkc15 data.
 * OpenPGP
diff --git a/src/libopensc/iso7816.c b/src/libopensc/iso7816.c
index 2ea08fb..7ad7dc2 100644
--- a/src/libopensc/iso7816.c
+++ b/src/libopensc/iso7816.c
@@ -892,6 +892,9 @@ iso7816_compute_signature(struct sc_card *card,
 	struct sc_apdu apdu;
 
 	assert(card != NULL && data != NULL && out != NULL);
+	LOG_FUNC_CALLED(card->ctx);
+	sc_log(card->ctx, "ISO7816 compute signature: in-len %i, out-len %i",
+		datalen, outlen);
 
 	/* INS: 0x2A  PERFORM SECURITY OPERATION
 	 * P1:  0x9E  Resp: Digital Signature
@@ -908,9 +911,8 @@ iso7816_compute_signature(struct sc_card *card,
 	fixup_transceive_length(card, &apdu);
 	r = sc_transmit_apdu(card, &apdu);
 	LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
-	if (apdu.sw1 == 0x90 && apdu.sw2 == 0x00) {
+	if (apdu.sw1 == 0x90 && apdu.sw2 == 0x00)
 		LOG_FUNC_RETURN(card->ctx, apdu.resplen);
-	}
 
 	r = sc_check_sw(card, apdu.sw1, apdu.sw2);
 	LOG_TEST_RET(card->ctx, r, "Card returned error");
@@ -924,12 +926,13 @@ iso7816_decipher(struct sc_card *card,
 		const u8 * crgram, size_t crgram_len,
 		u8 * out, size_t outlen)
 {
-	int       r;
+	int r;
 	struct sc_apdu apdu;
-	u8        *sbuf = NULL;
+	u8 *sbuf = NULL;
 
 	assert(card != NULL && crgram != NULL && out != NULL);
-	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL);
+	LOG_FUNC_CALLED(card->ctx);
+	sc_log(card->ctx, "ISO7816 decipher: in-len %i, out-len %i", crgram_len, outlen);
 
 	sbuf = malloc(crgram_len + 1);
 	if (sbuf == NULL)

-- 
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