summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-04-04 08:04:10 +0200
committerStef Walter <stefw@gnome.org>2013-04-04 08:04:10 +0200
commitd6e0982658acb231333ebfbfb7efff8b762231d0 (patch)
treec44466ce011d93da0503f306e0a4c933a9e5ade8 /common
parent032fbd8806333bdaf0201cfd9d7bcaac8ec75184 (diff)
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.
Diffstat (limited to 'common')
-rw-r--r--common/asn1.c12
1 files changed, 6 insertions, 6 deletions
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;
}