summaryrefslogtreecommitdiffstats
path: root/include/internal/ffc.h
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-07-13 15:06:00 +0200
committerTomas Mraz <tomas@openssl.org>2022-07-19 12:11:02 +0200
commit8ed6ddcaa559b7b04202c15ea3a95ee0b05caeba (patch)
tree76676c06c89ddb1e2426799a2d0ab26729d30c79 /include/internal/ffc.h
parentb89a5b8df909cb3c10b2efe72dc32755e66771b6 (diff)
For known safe primes use the minimum key length according to RFC 7919
Longer private key sizes unnecessarily raise the cycles needed to compute the shared secret without any increase of the real security. This fixes a regression from 1.1.1 where these shorter keys were generated for the known safe primes. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/18793)
Diffstat (limited to 'include/internal/ffc.h')
-rw-r--r--include/internal/ffc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/internal/ffc.h b/include/internal/ffc.h
index 79cb06aba3..50673efb89 100644
--- a/include/internal/ffc.h
+++ b/include/internal/ffc.h
@@ -112,6 +112,8 @@ typedef struct ffc_params_st {
*/
const char *mdname;
const char *mdprops;
+ /* Default key length for known named groups according to RFC7919 */
+ int keylength;
} FFC_PARAMS;
void ossl_ffc_params_init(FFC_PARAMS *params);
@@ -205,8 +207,9 @@ const DH_NAMED_GROUP *ossl_ffc_numbers_to_dh_named_group(const BIGNUM *p,
int ossl_ffc_named_group_get_uid(const DH_NAMED_GROUP *group);
const char *ossl_ffc_named_group_get_name(const DH_NAMED_GROUP *);
#ifndef OPENSSL_NO_DH
+int ossl_ffc_named_group_get_keylength(const DH_NAMED_GROUP *group);
const BIGNUM *ossl_ffc_named_group_get_q(const DH_NAMED_GROUP *group);
-int ossl_ffc_named_group_set_pqg(FFC_PARAMS *ffc, const DH_NAMED_GROUP *group);
+int ossl_ffc_named_group_set(FFC_PARAMS *ffc, const DH_NAMED_GROUP *group);
#endif
#endif /* OSSL_INTERNAL_FFC_H */