The result of a ^ 0 mod -1 is 0 not 1
authorMatt Caswell <matt@openssl.org>
Thu, 24 May 2018 15:12:52 +0000 (16:12 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 29 May 2018 15:43:18 +0000 (16:43 +0100)
commit4aa5b725d549b3ebc3a4f2f1c44e44a11f68752b
treea8d33eda3951b79bfec22fbd47efd6908934e8bf
parent3d0dde847eac17bd5deec1397bce38cb43469525
The result of a ^ 0 mod -1 is 0 not 1

Thanks to Guido Vranken and OSSFuzz for finding this issue.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6355)
crypto/bn/bn_exp.c