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:03 +0000 (19:33 +0200)
commitcf633fa00244e39eea2f2c0b623f7d5bbefa904e
tree5e65fffc011f2766df8219c39d00284ed295d5cc
parent732a6b55224c6c7b525b2cde4320312356304227
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