summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-04 15:44:38 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-04 17:17:31 +0200
commit23a5083e2902dc6d202fc74c512e9f3340665722 (patch)
tree4f0aa58e05197fccee83b9c12d8c78c2a3327294
parent4fe6302d8df924649305b92a7dabfd86ba5ff163 (diff)
downloadgnutls-23a5083e2902dc6d202fc74c512e9f3340665722.tar.gz
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.
-rw-r--r--lib/pkcs11_privkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pkcs11_privkey.c b/lib/pkcs11_privkey.c
index 805946c897..c5877d5d7e 100644
--- a/lib/pkcs11_privkey.c
+++ b/lib/pkcs11_privkey.c
@@ -386,9 +386,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;
}