[pkg-opensc-commit] [opensc] 144/295: asn1: print in log part of raw data to decode

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:25 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 b4cfb14e4cbefb831e8f5a63615bd263f821c399
Author: Viktor Tarasov <viktor.tarasov at gmail.com>
Date:   Sun Jan 1 13:55:25 2017 +0100

    asn1: print in log part of raw data to decode
    
    closes #926
---
 src/libopensc/asn1.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c
index 358e4c5..9b93143 100644
--- a/src/libopensc/asn1.c
+++ b/src/libopensc/asn1.c
@@ -1260,7 +1260,10 @@ static int asn1_decode_entry(sc_context_t *ctx,struct sc_asn1_entry *entry,
 
 	callback_func = parm;
 
-	sc_debug(ctx, SC_LOG_DEBUG_ASN1, "%*.*sdecoding '%s'\n", depth, depth, "", entry->name);
+	sc_debug(ctx, SC_LOG_DEBUG_ASN1, "%*.*sdecoding '%s', raw data:%s%s\n",
+		depth, depth, "", entry->name,
+		sc_dump_hex(obj, objlen > 16  ? 16 : objlen),
+		objlen > 16 ? "..." : "");
 
 	switch (entry->type) {
 	case SC_ASN1_STRUCT:
@@ -1482,7 +1485,7 @@ static int asn1_decode(sc_context_t *ctx, struct sc_asn1_entry *asn1,
 
 		obj = sc_asn1_skip_tag(ctx, &p, &left, entry->tag, &objlen);
 		if (obj == NULL) {
-			sc_debug(ctx, SC_LOG_DEBUG_ASN1, "not present\n");
+			sc_debug(ctx, SC_LOG_DEBUG_ASN1, "'%s' not present\n", entry->name);
 			if (choice)
 				continue;
 			if (entry->flags & SC_ASN1_OPTIONAL)

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