summaryrefslogtreecommitdiffstats
path: root/crypto/ffc
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-08-09 10:42:46 +0200
committerTomas Mraz <tomas@openssl.org>2021-08-11 12:07:08 +0200
commitaa5098021be2df0fd33bd5e8b1325c49dc519433 (patch)
treeb3b9d2f82b49f585608e9faadc5bfebbf4c14b09 /crypto/ffc
parentc96670e59a702de71d572958ff60fda5f78637c2 (diff)
Set FFC_PARAM_FLAG_VALIDATE_LEGACY on params generated with FIPS 186-2 gen
Fixes #16261 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16268)
Diffstat (limited to 'crypto/ffc')
-rw-r--r--crypto/ffc/ffc_params_generate.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/ffc/ffc_params_generate.c b/crypto/ffc/ffc_params_generate.c
index 36b5a873a7..f0601e1644 100644
--- a/crypto/ffc/ffc_params_generate.c
+++ b/crypto/ffc/ffc_params_generate.c
@@ -1047,7 +1047,11 @@ int ossl_ffc_params_FIPS186_2_generate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type, size_t L, size_t N,
int *res, BN_GENCB *cb)
{
- return ossl_ffc_params_FIPS186_2_gen_verify(libctx, params,
- FFC_PARAM_MODE_GENERATE,
- type, L, N, res, cb);
+ if (!ossl_ffc_params_FIPS186_2_gen_verify(libctx, params,
+ FFC_PARAM_MODE_GENERATE,
+ type, L, N, res, cb))
+ return 0;
+
+ ossl_ffc_params_enable_flags(params, FFC_PARAM_FLAG_VALIDATE_LEGACY, 1);
+ return 1;
}