diff options
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_locl.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_pmeth.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_locl.h b/src/lib/libcrypto/rsa/rsa_locl.h index 0d86799777..a10ea958b5 100644 --- a/src/lib/libcrypto/rsa/rsa_locl.h +++ b/src/lib/libcrypto/rsa/rsa_locl.h | |||
@@ -1,7 +1,9 @@ | |||
1 | /* $OpenBSD: rsa_locl.h,v 1.6 2019/10/24 16:26:13 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_locl.h,v 1.7 2019/10/31 13:10:40 jsing Exp $ */ |
2 | 2 | ||
3 | __BEGIN_HIDDEN_DECLS | 3 | __BEGIN_HIDDEN_DECLS |
4 | 4 | ||
5 | #define RSA_MIN_MODULUS_BITS 512 | ||
6 | |||
5 | typedef struct rsa_oaep_params_st { | 7 | typedef struct rsa_oaep_params_st { |
6 | X509_ALGOR *hashFunc; | 8 | X509_ALGOR *hashFunc; |
7 | X509_ALGOR *maskGenFunc; | 9 | X509_ALGOR *maskGenFunc; |
diff --git a/src/lib/libcrypto/rsa/rsa_pmeth.c b/src/lib/libcrypto/rsa/rsa_pmeth.c index 1d51e52fe2..1b6d1de35d 100644 --- a/src/lib/libcrypto/rsa/rsa_pmeth.c +++ b/src/lib/libcrypto/rsa/rsa_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_pmeth.c,v 1.29 2019/10/31 13:06:30 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_pmeth.c,v 1.30 2019/10/31 13:10:40 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -454,8 +454,8 @@ pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
454 | return 1; | 454 | return 1; |
455 | 455 | ||
456 | case EVP_PKEY_CTRL_RSA_KEYGEN_BITS: | 456 | case EVP_PKEY_CTRL_RSA_KEYGEN_BITS: |
457 | if (p1 < 256) { | 457 | if (p1 < RSA_MIN_MODULUS_BITS) { |
458 | RSAerror(RSA_R_INVALID_KEYBITS); | 458 | RSAerror(RSA_R_KEY_SIZE_TOO_SMALL); |
459 | return -2; | 459 | return -2; |
460 | } | 460 | } |
461 | rctx->nbits = p1; | 461 | rctx->nbits = p1; |