summaryrefslogtreecommitdiffstats
path: root/include/crypto/rsa.h
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-03-26 16:49:27 +0000
committerTomas Mraz <tomas@openssl.org>2021-03-30 19:22:33 +0200
commitc6b09ea0fe23a572a781681b3c1f436e8b0932fe (patch)
tree7faff1aad786605cd05cc823b1da74034e34c7e0 /include/crypto/rsa.h
parent6635ea531e9f7709e5880dd77fd4c3403a5c3db7 (diff)
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 <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14702)
Diffstat (limited to 'include/crypto/rsa.h')
-rw-r--r--include/crypto/rsa.h2
1 files changed, 2 insertions, 0 deletions
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 <openssl/x509.h>
# include "crypto/types.h"
+#define RSA_MIN_MODULUS_BITS 512
+
typedef struct rsa_pss_params_30_st {
int hash_algorithm_nid;
struct {