From c6b09ea0fe23a572a781681b3c1f436e8b0932fe Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 26 Mar 2021 16:49:27 +0000 Subject: Fix change in behaviour of EVP_PKEY_CTRL_RSA_KEYGEN_BITS In 1.1.1 the ctrl EVP_PKEY_CTRL_RSA_KEYGEN_BITS would fail immediately if the number of bits was too small. In 3.0 it always succeeds, and only fails later during the key generation stage. We fix that so that it fails early like it used to in 1.1.1. Note that in 1.1.1 it fails with a -2 return code. That is not the case in 3.0 and has not been addressed here (see #14442) Fixes #14443 Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14702) --- include/crypto/rsa.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/crypto/rsa.h') diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h index 69fa8a4d8a..73bf03f615 100644 --- a/include/crypto/rsa.h +++ b/include/crypto/rsa.h @@ -16,6 +16,8 @@ # include # include "crypto/types.h" +#define RSA_MIN_MODULUS_BITS 512 + typedef struct rsa_pss_params_30_st { int hash_algorithm_nid; struct { -- cgit v1.2.3