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>
This commit is contained in:
Mouse 2016-01-01 23:27:49 -05:00 committed by Richard Levitte
parent 75fdee0482
commit d65a8d0b7e

View file

@ -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)