Reject negative shifts for BN_rshift and BN_lshift
authorMatt Caswell <matt@openssl.org>
Tue, 19 May 2015 14:19:30 +0000 (15:19 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 22 May 2015 22:15:02 +0000 (23:15 +0100)
commit7cc18d8158b5fc2676393d99b51c30c135502107
tree45d10d9d5128ff63ade1d546f43e9b138aa9fa6e
parent2c55a0bc93bf578757ec5c85bdb3abe9cf3f4893
Reject negative shifts for BN_rshift and BN_lshift

The functions BN_rshift and BN_lshift shift their arguments to the right or
left by a specified number of bits. Unpredicatable results (including
crashes) can occur if a negative number is supplied for the shift value.

Thanks to Mateusz Kocielski (LogicalTrust), Marek Kroemeke and Filip Palian
for discovering and reporting this issue.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
crypto/bn/bn_err.c
crypto/bn/bn_shift.c
doc/crypto/BN_set_bit.pod
include/openssl/bn.h