summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa/rsa_pmeth.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2019-10-31 13:10:41 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2019-10-31 13:10:41 +0000
commitbfc6803e10a381ffdf7313315a96f008ade380f5 (patch)
tree8eb30a34f4a92621af3865e29da45c11ef5730f9 /lib/libcrypto/rsa/rsa_pmeth.c
parent935b93767a12adf1868d5a45f6e33ebeee0249d0 (diff)
Move RSA min modulus to a define and increase from 256 to 512 bits.
From OpenSSL 1.1.1d. ok inoguchi@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_pmeth.c')
-rw-r--r--lib/libcrypto/rsa/rsa_pmeth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/rsa/rsa_pmeth.c b/lib/libcrypto/rsa/rsa_pmeth.c
index 1d51e52fe26..1b6d1de35de 100644
--- a/lib/libcrypto/rsa/rsa_pmeth.c
+++ b/lib/libcrypto/rsa/rsa_pmeth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_pmeth.c,v 1.29 2019/10/31 13:06:30 jsing Exp $ */
+/* $OpenBSD: rsa_pmeth.c,v 1.30 2019/10/31 13:10:40 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -454,8 +454,8 @@ pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
return 1;
case EVP_PKEY_CTRL_RSA_KEYGEN_BITS:
- if (p1 < 256) {
- RSAerror(RSA_R_INVALID_KEYBITS);
+ if (p1 < RSA_MIN_MODULUS_BITS) {
+ RSAerror(RSA_R_KEY_SIZE_TOO_SMALL);
return -2;
}
rctx->nbits = p1;