Bug fix: Montgomery multiplication could produce results with the wrong
sign.
diff --git a/CHANGES b/CHANGES
index f3ff38a..a0a0512 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@
 
  Changes between 0.9.5a and 0.9.6  [xx XXX 2000]
 
+  *) Bug fix: Montgomery multiplication could produce results with the
+     wrong sign.
+     [Ulf Möller]
+
   *) Add RPM specification openssl.spec and modify it to build three
      packages.  The default package contains applications, application
      documentation and run-time libraries.  The devel package contains
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index d40a153..ca58ad3 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -190,6 +190,7 @@
 #if 0
 	BN_rshift(ret,r,mont->ri);
 #else
+	ret->neg = r->neg;
 	x=ri;
 	rp=ret->d;
 	ap= &(r->d[x]);