BN_mod_exp_mont_consttime: check for zero modulus.
authorEmilia Kasper <emilia@openssl.org>
Mon, 31 Aug 2015 13:51:27 +0000 (15:51 +0200)
committerEmilia Kasper <emilia@openssl.org>
Mon, 31 Aug 2015 17:33:42 +0000 (19:33 +0200)
commitd46e946d2603c64df6e1e4f9db0c70baaf1c4c03
tree2018e6c9e88a53e192e0cfe01f044dce86d0ba84
parentc88f65f5b5cdc01fc16ca38084aebfc141dcba03
BN_mod_exp_mont_consttime: check for zero modulus.

Don't dereference |d| when |top| is zero. Also test that various BIGNUM methods behave correctly on zero/even inputs.

Follow-up to b11980d79a52ec08844f08bea0e66c04b691840b

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bn/bn_exp.c
crypto/bn/bntest.c