diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c index aaa90740a..014738862 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)