summaryrefslogtreecommitdiffstats
path: root/crypto/ffc
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2023-02-27 16:35:41 +1000
committerPauli <pauli@openssl.org>2023-03-01 09:36:49 +1100
commit3307338e26862070eaacad6ec7537a63a63b8a90 (patch)
treeec6925b678da022afd52227a9df98a9e6b00f5c0 /crypto/ffc
parent5f820bd7535b871fdfdc0303c3af23ba4be901f0 (diff)
Fix FFC mdprop setting bugs.
Coverage testing showed that ossl_ffc_params_fromdata() was not setting OSSL_PKEY_PARAM_FFC_DIGEST_PROPS. Adding a negative test also showed that ossl_ffc_params_copy() did not do a shallow copy of the digest or digest property. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20385)
Diffstat (limited to 'crypto/ffc')
-rw-r--r--crypto/ffc/ffc_backend.c1
-rw-r--r--crypto/ffc/ffc_params.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/crypto/ffc/ffc_backend.c b/crypto/ffc/ffc_backend.c
index dbd28b0e66..01982bd6af 100644
--- a/crypto/ffc/ffc_backend.c
+++ b/crypto/ffc/ffc_backend.c
@@ -111,6 +111,7 @@ int ossl_ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[])
if (p1 != NULL) {
if (p1->data_type != OSSL_PARAM_UTF8_STRING)
goto err;
+ props = p1->data;
}
if (!ossl_ffc_set_digest(ffc, prm->data, props))
goto err;
diff --git a/crypto/ffc/ffc_params.c b/crypto/ffc/ffc_params.c
index fb558f8221..647d356eca 100644
--- a/crypto/ffc/ffc_params.c
+++ b/crypto/ffc/ffc_params.c
@@ -182,6 +182,8 @@ int ossl_ffc_params_copy(FFC_PARAMS *dst, const FFC_PARAMS *src)
|| !ffc_bn_cpy(&dst->j, src->j))
return 0;
+ dst->mdname = src->mdname;
+ dst->mdprops = src->mdprops;
OPENSSL_free(dst->seed);
dst->seedlen = src->seedlen;
if (src->seed != NULL) {