summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
diff options
context:
space:
mode:
authorJon Spillett <jon.spillett@oracle.com>2021-01-13 14:10:51 +1000
committerTomas Mraz <tomas@openssl.org>2021-01-15 17:24:41 +0100
commit2c04b34140be8833dae0e4debcb6ebf5fd0f287c (patch)
tree17019aebe6688c917b52ac6bdeec596ab241d8b3 /crypto/dsa
parent39f3427dc1cd8cf72cf4b3c8c26256874a067bfd (diff)
Allow EVP_PKEY private key objects to be created without a public component
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13855)
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_backend.c7
-rw-r--r--crypto/dsa/dsa_lib.c7
2 files changed, 0 insertions, 14 deletions
diff --git a/crypto/dsa/dsa_backend.c b/crypto/dsa/dsa_backend.c
index 4809b3100b..6a053611e1 100644
--- a/crypto/dsa/dsa_backend.c
+++ b/crypto/dsa/dsa_backend.c
@@ -39,13 +39,6 @@ int dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[])
if (param_priv_key == NULL && param_pub_key == NULL)
return 1;
- /*
- * DSA documentation says that a public key must be present if a
- * private key is present.
- */
- if (param_priv_key != NULL && param_pub_key == NULL)
- return 0;
-
if (param_pub_key != NULL && !OSSL_PARAM_get_BN(param_pub_key, &pub_key))
goto err;
if (param_priv_key != NULL && !OSSL_PARAM_get_BN(param_priv_key, &priv_key))
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index df9dd73dfd..7488fa2451 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -310,13 +310,6 @@ void DSA_get0_key(const DSA *d,
int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
{
- /* If the field pub_key in d is NULL, the corresponding input
- * parameters MUST be non-NULL. The priv_key field may
- * be left NULL.
- */
- if (d->pub_key == NULL && pub_key == NULL)
- return 0;
-
if (pub_key != NULL) {
BN_free(d->pub_key);
d->pub_key = pub_key;