From: Mouse Date: Sat, 2 Jan 2016 04:27:49 +0000 (-0500) Subject: Fixed a bug preventing pkeyutl from accessing keys directly on the token via engine_p... X-Git-Tag: OpenSSL_1_0_2f~22 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d65a8d0b7e4b95e79c65972eaa05ba776c5af462;p=oweals%2Fopenssl.git Fixed a bug preventing pkeyutl from accessing keys directly on the token via engine_pkcs11 Reviewed-by: Rich Salz Reviewed-by: Richard Levitte --- 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)