From 4bbb7038816d3664c92cb442e3d1ccac8f92f83c Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 3 Jul 2013 12:45:11 +0200 Subject: trust: Correctly handle persisting OIDs with zero length --- trust/persist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trust/persist.c b/trust/persist.c index 0e98b46..f70240a 100644 --- a/trust/persist.c +++ b/trust/persist.c @@ -39,6 +39,7 @@ #include "constants.h" #include "debug.h" #include "lexer.h" +#include "message.h" #include "pem.h" #include "persist.h" #include "pkcs11.h" @@ -445,7 +446,7 @@ format_oid (p11_persist *persist, int len; int ret; - if (attr->type != CKA_OBJECT_ID) + if (attr->type != CKA_OBJECT_ID || attr->ulValueLen == 0) return false; if (!persist->asn1_defs) { @@ -466,7 +467,7 @@ format_oid (p11_persist *persist, ret = asn1_der_decoding (&asn, attr->pValue, attr->ulValueLen, message); if (ret != ASN1_SUCCESS) { - p11_debug_precond ("invalid oid value: %s", message); + p11_message ("invalid oid value: %s", message); return false; } -- cgit v1.1