summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-10 08:13:34 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-10 08:13:34 +0100
commitebf2a6f83213ba44d3b28a7bffcdc184ea663624 (patch)
tree280bc2fc8aaa60a90df089c823bc5c5f5908171d
parentb54a854f1db61b7f5d6e5429166a0f5193847385 (diff)
downloadgnutls-ebf2a6f83213ba44d3b28a7bffcdc184ea663624.tar.gz
write the proper key ID in the token
-rw-r--r--lib/pkcs11_write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c
index 0af3f672ca..d648b2c9d6 100644
--- a/lib/pkcs11_write.c
+++ b/lib/pkcs11_write.c
@@ -106,7 +106,10 @@ gnutls_pkcs11_copy_x509_crt (const char *token_url,
}
id_size = sizeof (id);
- ret = gnutls_x509_crt_get_key_id (crt, 0, id, &id_size);
+ ret = gnutls_x509_crt_get_subject_key_id(crt, id, &id_size, NULL);
+
+ if (ret < 0)
+ ret = gnutls_x509_crt_get_key_id (crt, 0, id, &id_size);
if (ret < 0)
{
gnutls_assert ();