Fix BN_rshift.
authorBodo Möller <bodo@openssl.org>
Thu, 30 Nov 2000 22:35:52 +0000 (22:35 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 30 Nov 2000 22:35:52 +0000 (22:35 +0000)
CHANGES
crypto/bn/bn_shift.c

diff --git a/CHANGES b/CHANGES
index 845bf5fd8c2ce98082000d7ad6f7764aa72bd692..b55d49e07ca1512f0440474555e929f8ef6eafe8 100644 (file)
--- 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
index 0883247384e97a4d8ac9c37f83c4c4a21cb49b96..c2608f9f4a900ba51920f95f2cedbb371791f919 100644 (file)
@@ -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;