diff options
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index 980c9b5457..3ca2b7f14b 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.79 2023/03/31 19:39:15 tb Exp $ */ | 1 | /* $OpenBSD: bn_lib.c,v 1.80 2023/04/01 12:44:56 tb 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 | * |
@@ -209,15 +209,19 @@ BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) | |||
209 | dest->flags = dest_flags; | 209 | dest->flags = dest_flags; |
210 | } | 210 | } |
211 | 211 | ||
212 | static const BN_ULONG bn_value_one_data = 1; | ||
213 | static const BIGNUM bn_value_one = { | ||
214 | .d = (BN_ULONG *)&bn_value_one_data, | ||
215 | .top = 1, | ||
216 | .dmax = 1, | ||
217 | .neg = 0, | ||
218 | .flags = BN_FLG_STATIC_DATA, | ||
219 | }; | ||
220 | |||
212 | const BIGNUM * | 221 | const BIGNUM * |
213 | BN_value_one(void) | 222 | BN_value_one(void) |
214 | { | 223 | { |
215 | static const BN_ULONG data_one = 1L; | 224 | return &bn_value_one; |
216 | static const BIGNUM const_one = { | ||
217 | (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA | ||
218 | }; | ||
219 | |||
220 | return (&const_one); | ||
221 | } | 225 | } |
222 | 226 | ||
223 | #ifndef HAVE_BN_WORD_CLZ | 227 | #ifndef HAVE_BN_WORD_CLZ |