diff options
author | 2003-09-25 19:55:36 +0000 | |
---|---|---|
committer | 2003-09-25 19:55:36 +0000 | |
commit | 3b996182c4be0a74fe7f0ff43cc980576926a356 (patch) | |
tree | f8dae02c487bbc5f248e09c3beac32cf136ef388 /lib/libssl/src | |
parent | Use BN_is_zero(), not x->top == 0 to test if a BN is zero. (diff) | |
download | wireguard-openbsd-3b996182c4be0a74fe7f0ff43cc980576926a356.tar.xz wireguard-openbsd-3b996182c4be0a74fe7f0ff43cc980576926a356.zip |
Return immediately if argument to BN_sub_word is zero.
ok markus@ deraadt@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/bn/bn_word.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libssl/src/crypto/bn/bn_word.c b/lib/libssl/src/crypto/bn/bn_word.c index ab858d70ff6..de610ce54c2 100644 --- a/lib/libssl/src/crypto/bn/bn_word.c +++ b/lib/libssl/src/crypto/bn/bn_word.c @@ -146,6 +146,9 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w) { int i; + if ((w & BN_MASK2) == 0) + return(1); + if (BN_is_zero(a) || a->neg) { a->neg=0; |