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:51:52 +0000 (16:51 +0100)
commit235119f015e46a74040b78b10fd6e954f7f07774
tree6ef53ac39ab74506560a84018ce08b39f1f63bc1
parentd8908c3310240bb0efd9b17c663a8b9e47bf31dc
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)

(cherry picked from commit 4aa5b725d549b3ebc3a4f2f1c44e44a11f68752b)
crypto/bn/bn_exp.c