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:48:49 +0000 (16:48 +0100)
commitac35f285bd45997ad7d75033f638b01cd77fec6c
tree2a3dfc64370d8f017f0903876a249721ca5a1c06
parent10fe37dd1bb7f75ca68a442406c09ada6735f38b
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