From d6e0982658acb231333ebfbfb7efff8b762231d0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 4 Apr 2013 08:04:10 +0200 Subject: Don't print erroneous debug messages when skipping files The parser automatically skips over files that it cannot parse. Don't print confusing debug messages about DER parse failures when it does so. --- common/asn1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/asn1.c b/common/asn1.c index 45d91ab..29cca3a 100644 --- a/common/asn1.c +++ b/common/asn1.c @@ -142,18 +142,18 @@ p11_asn1_decode (p11_dict *asn1_defs, return_val_if_fail (asn1_defs != NULL, NULL); - if (message == NULL) - message = msg; - asn = p11_asn1_create (asn1_defs, struct_name); return_val_if_fail (asn != NULL, NULL); /* asn1_der_decoding destroys the element if fails */ - ret = asn1_der_decoding (&asn, der, der_len, message); + ret = asn1_der_decoding (&asn, der, der_len, message ? message : msg); if (ret != ASN1_SUCCESS) { - p11_debug ("couldn't parse %s: %s: %s", - struct_name, asn1_strerror (ret), message); + /* If caller passed in a message buffer, assume they're logging */ + if (!message) { + p11_debug ("couldn't parse %s: %s: %s", + struct_name, asn1_strerror (ret), msg); + } return NULL; } -- cgit v1.1