summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMouse <mouse008@gmail.com>2016-01-01 23:27:49 -0500
committerRichard Levitte <levitte@openssl.org>2016-01-13 01:23:34 +0100
commitd65a8d0b7e4b95e79c65972eaa05ba776c5af462 (patch)
treed1466d34e400480e5c606005eb220e97e98f488e /apps
parent75fdee04827a2e7bd809dc9cc086389e856947b9 (diff)
Fixed a bug preventing pkeyutl from accessing keys directly on the token via engine_pkcs11
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/pkeyutl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index aaa90740ad..014738862c 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -419,8 +419,13 @@ static EVP_PKEY_CTX *init_ctx(int *pkeysize,
if (!pkey)
goto end;
- ctx = EVP_PKEY_CTX_new(pkey, e);
-
+ if ((keyform == FORMAT_ENGINE) && (strncmp(ENGINE_get_name(e),"pkcs11 engine", strlen("pkcs11 engine"))==0)) {
+ fprintf(stderr, "engine name = \"%s\"\n", ENGINE_get_name(e));
+ ctx = EVP_PKEY_CTX_new(pkey, NULL);
+ } else {
+ ctx = EVP_PKEY_CTX_new(pkey, e);
+ }
+
EVP_PKEY_free(pkey);
if (!ctx)