From a76ccb9d0ddc24f6551afbc220b41fb3c4e64c6a Mon Sep 17 00:00:00 2001 From: slontis Date: Wed, 22 Feb 2023 14:16:05 +1000 Subject: FFC cleanups Discovered during coverage testing. Remove unneccesary check when using ossl_dh_get0_params() and ossl_dsa_get0_params(). These point to addresses and can not fail for any existing calls. Make dsa keygen tests only available in the FIPS module - as they are not used in the default provider. Change ossl_ffc_set_digest() to return void as it cannot fail. Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20359) --- providers/implementations/keymgmt/dh_kmgmt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'providers/implementations/keymgmt/dh_kmgmt.c') diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c index 2ca12df442..1de182ce6f 100644 --- a/providers/implementations/keymgmt/dh_kmgmt.c +++ b/providers/implementations/keymgmt/dh_kmgmt.c @@ -735,10 +735,8 @@ static void *dh_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) } else if (gctx->hindex != 0) { ossl_ffc_params_set_h(ffc, gctx->hindex); } - if (gctx->mdname != NULL) { - if (!ossl_ffc_set_digest(ffc, gctx->mdname, gctx->mdprops)) - goto end; - } + if (gctx->mdname != NULL) + ossl_ffc_set_digest(ffc, gctx->mdname, gctx->mdprops); gctx->cb = osslcb; gctx->cbarg = cbarg; gencb = BN_GENCB_new(); -- cgit v1.2.1