diff options
-rw-r--r-- | src/lib/libcrypto/bn/bn_word.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c index c900f9ee2e..68d5c2a4b4 100644 --- a/src/lib/libcrypto/bn/bn_word.c +++ b/src/lib/libcrypto/bn/bn_word.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_word.c,v 1.19 2023/03/11 14:13:11 jsing Exp $ */ | 1 | /* $OpenBSD: bn_word.c,v 1.20 2023/03/11 14:14:54 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 | * |
@@ -131,6 +131,10 @@ BN_div_word(BIGNUM *a, BN_ULONG w) | |||
131 | if ((a->top > 0) && (a->d[a->top - 1] == 0)) | 131 | if ((a->top > 0) && (a->d[a->top - 1] == 0)) |
132 | a->top--; | 132 | a->top--; |
133 | ret >>= j; | 133 | ret >>= j; |
134 | |||
135 | /* Set negative again, to handle -0 case. */ | ||
136 | BN_set_negative(a, a->neg); | ||
137 | |||
134 | return (ret); | 138 | return (ret); |
135 | } | 139 | } |
136 | 140 | ||