summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index b59e65a1e1..6988a70f3b 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.91 2024/04/15 14:35:25 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.92 2024/04/16 13:04:05 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -219,13 +219,10 @@ bn_expand_internal(BIGNUM *bn, int words)
219} 219}
220 220
221int 221int
222bn_expand(BIGNUM *bn, int bits) 222bn_expand_bits(BIGNUM *bn, size_t bits)
223{ 223{
224 int words; 224 int words;
225 225
226 if (bits < 0)
227 return 0;
228
229 if (bits > (INT_MAX - BN_BITS2 + 1)) 226 if (bits > (INT_MAX - BN_BITS2 + 1))
230 return 0; 227 return 0;
231 228