DSA mod inverse fix
authorPauli <paul.dale@oracle.com>
Sun, 28 Oct 2018 20:50:51 +0000 (06:50 +1000)
committerPauli <paul.dale@oracle.com>
Sun, 28 Oct 2018 20:50:51 +0000 (06:50 +1000)
commit415c33563528667868c3c653a612e6fc8736fd79
tree5093f6c5fd5b101edf24390e8b2308db60402d49
parent59f90557dd6e35cf72ac72016609d759ac78fcb9
DSA mod inverse fix

There is a side channel attack against the division used to calculate one of
the modulo inverses in the DSA algorithm.  This change takes advantage of the
primality of the modulo and Fermat's little theorem to calculate the inverse
without leaking information.

Thanks to Samuel Weiser for finding and reporting this.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/7487)
crypto/dsa/dsa_ossl.c