From: Nikos Mavrogiannopoulos Date: Fri, 4 Jul 2014 13:44:38 +0000 (+0200) Subject: pkcs11: Removed length check of attribute as a sanity check for valid keys. X-Git-Tag: gnutls_3_3_6~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6b802bbe172b55d5ebb76eb6dfe495da93965ef;p=thirdparty%2Fgnutls.git pkcs11: Removed length check of attribute as a sanity check for valid keys. There can be keys where the id or label is empty and thus with zero length. --- diff --git a/lib/pkcs11_privkey.c b/lib/pkcs11_privkey.c index e6c3ff3358..20a05f5c7f 100644 --- a/lib/pkcs11_privkey.c +++ b/lib/pkcs11_privkey.c @@ -419,9 +419,9 @@ gnutls_pkcs11_privkey_import_url(gnutls_pkcs11_privkey_t pkey, } attr = p11_kit_uri_get_attribute(pkey->info, CKA_ID); - if (!attr || !attr->value_len) { + if (!attr) { attr = p11_kit_uri_get_attribute(pkey->info, CKA_LABEL); - if (!attr || !attr->value_len) { + if (!attr) { gnutls_assert(); return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; }