From: Bodo Möller Date: Thu, 30 Nov 2000 22:35:52 +0000 (+0000) Subject: Fix BN_rshift. X-Git-Tag: OpenSSL_0_9_6a-beta1~112 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d2c38b1c737b4f154d4a5d3a6a1e0e2ca0093178;p=oweals%2Fopenssl.git Fix BN_rshift. --- diff --git a/CHANGES b/CHANGES index 845bf5fd8c..b55d49e07c 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Changes between 0.9.6 and 0.9.6a [xx XXX 2000] + *) BN_rshift bugfix for n == 0. + [Bodo Moeller] + *) Store verify_result within SSL_SESSION also for client side to avoid potential security hole. (Re-used sessions on the client side always resulted in verify_result==X509_V_OK, not using the original diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c index 0883247384..c2608f9f4a 100644 --- a/crypto/bn/bn_shift.c +++ b/crypto/bn/bn_shift.c @@ -172,6 +172,11 @@ int BN_rshift(BIGNUM *r, BIGNUM *a, int n) r->neg=a->neg; if (bn_wexpand(r,a->top-nw+1) == NULL) return(0); } + else + { + if (n == 0) + return 1; /* or the copying loop will go berserk */ + } f= &(a->d[nw]); t=r->d;