]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
pkcs11: Removed length check of attribute as a sanity check for valid keys.
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 4 Jul 2014 13:44:38 +0000 (15:44 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 4 Jul 2014 13:45:15 +0000 (15:45 +0200)
There can be keys where the id or label is empty and thus with zero length.

lib/pkcs11_privkey.c

index e6c3ff3358d70aa1f946aac9220bdea428a558cb..20a05f5c7f559784a084b8f7145733ff742f90c3 100644 (file)
@@ -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;
                }