summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-02-02 12:55:05 +0100
committerRichard Levitte <levitte@openssl.org>2020-02-04 19:32:37 +0100
commit00bc1ad99a69f851ccdea3656445ae2daaf70717 (patch)
tree65108cbd96ef9c13ae4c141bea543dfa624354cb /providers
parent972fa31895b38cbe91a87a04875f7dadee387dea (diff)
Don't pass a digest-size to signature implementations
It turns out this was never necessary, as the implementation should always check the default digest size anyway. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10947)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/fipsprov.c4
-rw-r--r--providers/implementations/signature/dsa.c11
2 files changed, 1 insertions, 14 deletions
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index 288168cb81..c89fa64264 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -276,9 +276,7 @@ static int dsa_key_signature_test(OPENSSL_CTX *libctx)
/* set signature parameters */
ossl_param_bld_init(&bld);
if (!ossl_param_bld_push_utf8_string(&bld, OSSL_SIGNATURE_PARAM_DIGEST,
- SN_sha256,strlen(SN_sha256) + 1)
- || !ossl_param_bld_push_size_t(&bld, OSSL_SIGNATURE_PARAM_DIGEST_SIZE,
- SHA256_DIGEST_LENGTH))
+ SN_sha256,strlen(SN_sha256) + 1))
goto err;
params_sig = ossl_param_bld_to_param(&bld);
if (EVP_PKEY_CTX_set_params(sctx, params_sig) <= 0)
diff --git a/providers/implementations/signature/dsa.c b/providers/implementations/signature/dsa.c
index e8d9cd0b81..eaf6d4fe29 100644
--- a/providers/implementations/signature/dsa.c
+++ b/providers/implementations/signature/dsa.c
@@ -206,7 +206,6 @@ static int dsa_digest_signverify_init(void *vpdsactx, const char *mdname,
EVP_MD_CTX_free(pdsactx->mdctx);
EVP_MD_free(pdsactx->md);
pdsactx->mdctx = NULL;
- pdsactx->mdsize = 0;
pdsactx->md = NULL;
return 0;
}
@@ -330,10 +329,6 @@ static int dsa_get_ctx_params(void *vpdsactx, OSSL_PARAM *params)
&& !OSSL_PARAM_set_octet_string(p, pdsactx->aid, pdsactx->aid_len))
return 0;
- p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
- if (p != NULL && !OSSL_PARAM_set_size_t(p, pdsactx->mdsize))
- return 0;
-
p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST);
if (p != NULL && !OSSL_PARAM_set_utf8_string(p, pdsactx->md == NULL
? pdsactx->mdname
@@ -345,7 +340,6 @@ static int dsa_get_ctx_params(void *vpdsactx, OSSL_PARAM *params)
static const OSSL_PARAM known_gettable_ctx_params[] = {
OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
- OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
OSSL_PARAM_END
};
@@ -372,10 +366,6 @@ static int dsa_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
return 1;
}
- p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
- if (p != NULL && !OSSL_PARAM_get_size_t(p, &pdsactx->mdsize))
- return 0;
-
/*
* We never actually use the mdname, but we do support getting it later.
* This can be useful for applications that want to know the MD that they
@@ -391,7 +381,6 @@ static int dsa_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
OSSL_PARAM_END
};