diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-07 08:44:46 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-07 08:56:41 +0100 |
commit | 52dacdc599683c736c4bd72b3b94cc825f41982b (patch) | |
tree | b36e71496b851bc54f75a19d9c1e3bbec18e538b /lib/pkcs11_write.c | |
parent | 7a9176d2c8febd60a964895df5062419f4d95e6d (diff) | |
download | gnutls-52dacdc599683c736c4bd72b3b94cc825f41982b.tar.gz |
pkcs11: added the flag GNUTLS_PKCS11_OBJ_FLAG_MARK_ALWAYS_AUTH
Diffstat (limited to 'lib/pkcs11_write.c')
-rw-r--r-- | lib/pkcs11_write.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c index b0b6e95f72..d1a19cf35c 100644 --- a/lib/pkcs11_write.c +++ b/lib/pkcs11_write.c @@ -79,7 +79,7 @@ static void mark_flags(unsigned flags, struct ck_attribute *a, unsigned *a_val) * This function will copy a certificate into a PKCS #11 token specified by * a URL. Valid flags to mark the certificate: %GNUTLS_PKCS11_OBJ_FLAG_MARK_TRUSTED, * %GNUTLS_PKCS11_OBJ_FLAG_MARK_SENSITIVE, %GNUTLS_PKCS11_OBJ_FLAG_MARK_PRIVATE, - * %GNUTLS_PKCS11_OBJ_FLAG_MARK_CA. + * %GNUTLS_PKCS11_OBJ_FLAG_MARK_CA, %GNUTLS_PKCS11_OBJ_FLAG_MARK_ALWAYS_AUTH. * * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a * negative error value. @@ -431,6 +431,13 @@ gnutls_pkcs11_copy_x509_privkey(const char *token_url, a_val++; } + if (flags & GNUTLS_PKCS11_OBJ_FLAG_MARK_ALWAYS_AUTH) { + a[a_val].type = CKA_ALWAYS_AUTHENTICATE; + a[a_val].value = (void *) &tval; + a[a_val].value_len = sizeof(tval); + a_val++; + } + if (label) { a[a_val].type = CKA_LABEL; a[a_val].value = (void *) label; |