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:25:59 +0000 (19:25 +0200)
commita9009e518ca03f35a1e1a0858faf81865f8eff1e
treea2bfd81e795639693e5ff02476b07c73df6fad46
parent6dc08048d93ff35de882878f190ae49aa698b5d2
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
test/bntest.c