summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorotto <>2003-09-25 19:55:36 +0000
committerotto <>2003-09-25 19:55:36 +0000
commitc6223f04e5580b6affc19d5f7518c523814b7da8 (patch)
tree246726fda43da5686b8920a04af1e3061191034c /src/lib
parentcff7518117b7df6884d44414f64caaf7687f2e9b (diff)
downloadopenbsd-c6223f04e5580b6affc19d5f7518c523814b7da8.tar.gz
openbsd-c6223f04e5580b6affc19d5f7518c523814b7da8.tar.bz2
openbsd-c6223f04e5580b6affc19d5f7518c523814b7da8.zip
Return immediately if argument to BN_sub_word is zero.
ok markus@ deraadt@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bn/bn_word.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_word.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index ab858d70ff..de610ce54c 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -146,6 +146,9 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
146 { 146 {
147 int i; 147 int i;
148 148
149 if ((w & BN_MASK2) == 0)
150 return(1);
151
149 if (BN_is_zero(a) || a->neg) 152 if (BN_is_zero(a) || a->neg)
150 { 153 {
151 a->neg=0; 154 a->neg=0;
diff --git a/src/lib/libssl/src/crypto/bn/bn_word.c b/src/lib/libssl/src/crypto/bn/bn_word.c
index ab858d70ff..de610ce54c 100644
--- a/src/lib/libssl/src/crypto/bn/bn_word.c
+++ b/src/lib/libssl/src/crypto/bn/bn_word.c
@@ -146,6 +146,9 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
146 { 146 {
147 int i; 147 int i;
148 148
149 if ((w & BN_MASK2) == 0)
150 return(1);
151
149 if (BN_is_zero(a) || a->neg) 152 if (BN_is_zero(a) || a->neg)
150 { 153 {
151 a->neg=0; 154 a->neg=0;