diff options
author | Richard Levitte <levitte@openssl.org> | 2017-02-01 02:29:46 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-02-01 02:31:41 +0100 |
commit | 0a2dcb6990dacc94337f746f4f4a6dfac1fbeac4 (patch) | |
tree | f6dc194c1aeacc67789a8f4ee51705f42d1a1ed8 /crypto/bn | |
parent | 38d1b3cc0271008b8bd130a2c4b442775b028a08 (diff) |
bn: fix occurance of negative zero in BN_rshift1()
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn_shift.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c index b320602871..6a1eec80af 100644 --- a/crypto/bn/bn_shift.c +++ b/crypto/bn/bn_shift.c @@ -74,6 +74,8 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a) c = (t & 1) ? BN_TBIT : 0; } r->top = j; + if (!r->top) + r->neg = 0; /* don't allow negative zero */ bn_check_top(r); return (1); } |