diff options
author | Matt Caswell <matt@openssl.org> | 2015-05-19 15:19:30 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-05-22 23:19:34 +0100 |
commit | 1a9499cf23dfd441628f37c29cfe5ac615255ee1 (patch) | |
tree | e1a9bc9bd70c78ea98433a351f09bf0b2ba3312f /crypto/bn/bn.h | |
parent | 254c01ed548263cf7128f54dc5c51b4df18f9b37 (diff) |
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>
(cherry picked from commit 7cc18d8158b5fc2676393d99b51c30c135502107)
Conflicts:
crypto/bn/bn.h
crypto/bn/bn_err.c
Diffstat (limited to 'crypto/bn/bn.h')
-rw-r--r-- | crypto/bn/bn.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index 9996b4a3bb..7311c0a8cf 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -893,6 +893,7 @@ void ERR_load_BN_strings(void); # define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 # define BN_F_BN_GF2M_MOD_SQR 136 # define BN_F_BN_GF2M_MOD_SQRT 137 +# define BN_F_BN_LSHIFT 145 # define BN_F_BN_MOD_EXP2_MONT 118 # define BN_F_BN_MOD_EXP_MONT 109 # define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 @@ -908,6 +909,7 @@ void ERR_load_BN_strings(void); # define BN_F_BN_NEW 113 # define BN_F_BN_RAND 114 # define BN_F_BN_RAND_RANGE 122 +# define BN_F_BN_RSHIFT 146 # define BN_F_BN_USUB 115 /* Reason codes. */ @@ -921,6 +923,7 @@ void ERR_load_BN_strings(void); # define BN_R_INPUT_NOT_REDUCED 110 # define BN_R_INVALID_LENGTH 106 # define BN_R_INVALID_RANGE 115 +# define BN_R_INVALID_SHIFT 119 # define BN_R_NOT_A_SQUARE 111 # define BN_R_NOT_INITIALIZED 107 # define BN_R_NO_INVERSE 108 |