summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-11-28 16:00:34 +0100
committerSimo Sorce <simo@redhat.com>2018-11-30 13:51:24 -0500
commited3bdddab73c792364deec423b2c2c498a939a64 (patch)
tree71d9cb80794ee78a38d1fbaa26fda5a585f831cb /lib
parent6b340c28f020edde61c16700048540d6eb2e8c17 (diff)
downloadgnutls-ed3bdddab73c792364deec423b2c2c498a939a64.tar.gz
Added test about rsa decryption under pkcs11
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/pkcs11_write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c
index 98afd169c7..4a83018fd8 100644
--- a/lib/pkcs11_write.c
+++ b/lib/pkcs11_write.c
@@ -753,7 +753,8 @@ gnutls_pkcs11_copy_x509_privkey2(const char *token_url,
if (pk == GNUTLS_PK_RSA) {
a[a_val].type = CKA_DECRYPT;
- if (key_usage & (GNUTLS_KEY_ENCIPHER_ONLY|GNUTLS_KEY_DECIPHER_ONLY)) {
+ if ((key_usage & (GNUTLS_KEY_ENCIPHER_ONLY|GNUTLS_KEY_DECIPHER_ONLY)) ||
+ (key_usage & GNUTLS_KEY_KEY_ENCIPHERMENT)) {
a[a_val].value = (void*)&tval;
a[a_val].value_len = sizeof(tval);
} else {