diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-09 19:50:50 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-09 19:50:50 +0100 |
commit | 2f1a93764b8a525be32d6cb581a9b121fb7253a0 (patch) | |
tree | 4a5799266e589dd7bb6000521a8f1594b388e454 /lib | |
parent | 39f21d902a2d838da4469bfe25f6fcd3bfd753f4 (diff) | |
download | gnutls-2f1a93764b8a525be32d6cb581a9b121fb7253a0.tar.gz |
simplified gnutls_pkcs11_copy_x509_crt()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pkcs11_write.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c index 61971035e6..d263645c45 100644 --- a/lib/pkcs11_write.c +++ b/lib/pkcs11_write.c @@ -60,7 +60,6 @@ gnutls_pkcs11_copy_x509_crt(const char *token_url, ck_certificate_type_t type = CKC_X_509; ck_object_handle_t obj; int a_val; - gnutls_datum_t subject = { NULL, 0 }; struct pkcs11_session_info sinfo; memset(&sinfo, 0, sizeof(sinfo)); @@ -112,12 +111,6 @@ gnutls_pkcs11_copy_x509_crt(const char *token_url, goto cleanup; } - ret = gnutls_x509_crt_get_raw_dn(crt, &subject); - if (ret < 0) { - gnutls_assert(); - goto cleanup; - } - /* FIXME: copy key usage flags */ a[0].type = CKA_CLASS; @@ -139,8 +132,8 @@ gnutls_pkcs11_copy_x509_crt(const char *token_url, a_val = 5; a[a_val].type = CKA_SUBJECT; - a[a_val].value = subject.data; - a[a_val].value_len = subject.size; + a[a_val].value = crt->raw_dn.data; + a[a_val].value_len = crt->raw_dn.size; a_val++; if (label) { @@ -190,7 +183,6 @@ gnutls_pkcs11_copy_x509_crt(const char *token_url, cleanup: gnutls_free(der); pkcs11_close_session(&sinfo); - _gnutls_free_datum(&subject); return ret; } |