diff options
-rw-r--r-- | lib/pkcs11_write.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c index 3c128d23b4..8d5081a4ad 100644 --- a/lib/pkcs11_write.c +++ b/lib/pkcs11_write.c @@ -722,11 +722,6 @@ gnutls_pkcs11_copy_x509_privkey2(const char *token_url, a_val++; } - a[a_val].type = CKA_KEY_TYPE; - a[a_val].value = &type; - a[a_val].value_len = sizeof(type); - a_val++; - a[a_val].type = CKA_TOKEN; a[a_val].value = (void *) &tval; a[a_val].value_len = sizeof(tval); @@ -916,6 +911,11 @@ gnutls_pkcs11_copy_x509_privkey2(const char *token_url, goto cleanup; } + a[a_val].type = CKA_KEY_TYPE; + a[a_val].value = &type; + a[a_val].value_len = sizeof(type); + a_val++; + rv = pkcs11_create_object(sinfo.module, sinfo.pks, a, a_val, &obj); if (rv != CKR_OK) { gnutls_assert(); |