summaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_gn.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-04-15 09:54:11 +0200
committerPauli <paul.dale@oracle.com>2020-04-17 19:50:03 +1000
commitd0ddf9b409495e8e2adab8a6b5bc38b34273341a (patch)
tree84254d0480cef857e6b399ef9cce2f6c9990d0c5 /crypto/evp/pmeth_gn.c
parent6f892296038490a7fa24b32ac6f7305687634fb0 (diff)
EVP: Fix calls to evp_pkey_export_to_provider()
The calls weren't quite right, as this function has changed its behaviour. We also change the internal documentation of this function, and document evp_pkey_downgrade(). Fixes #11549 Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11550)
Diffstat (limited to 'crypto/evp/pmeth_gn.c')
-rw-r--r--crypto/evp/pmeth_gn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c
index 78ed9ec781..95e3185573 100644
--- a/crypto/evp/pmeth_gn.c
+++ b/crypto/evp/pmeth_gn.c
@@ -170,8 +170,12 @@ int EVP_PKEY_gen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
&tmp_keymgmt, ctx->propquery);
- if (keydata == NULL)
+ if (tmp_keymgmt == NULL)
goto not_supported;
+ /*
+ * It's ok if keydata is NULL here. The backend is expected to deal
+ * with that as it sees fit.
+ */
ret = evp_keymgmt_gen_set_template(ctx->keymgmt,
ctx->op.keymgmt.genctx, keydata);
}