Fix a ** 0 mod 1 = 0 for real this time.
authorEmilia Kasper <emilia@openssl.org>
Mon, 14 Dec 2015 15:38:15 +0000 (16:38 +0100)
committerEmilia Kasper <emilia@openssl.org>
Mon, 14 Dec 2015 16:57:49 +0000 (17:57 +0100)
commit44e4f5b04b43054571e278381662cebd3f3555e6
tree510b92592b475a51189d037d9e66299ea9a3cc24
parent474a53b3a36568d19d7b918ee879efd2707e7c67
Fix a ** 0 mod 1 = 0 for real this time.

Commit 2b0180c37fa6ffc48ee40caa831ca398b828e680 attempted to do this but
only hit one of many BN_mod_exp codepaths. Fix remaining variants and add
a test for each method.

Thanks to Hanno Boeck for reporting this issue.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit d911097d7c93e4cfeab624b34d73fe51da158b69)
crypto/bn/bn_exp.c
crypto/bn/exptest.c