]> git.ipfire.org Git - thirdparty/hostap.git/commit
OpenSSL: Use constant time operations for private bignums
authorJouni Malinen <jouni@codeaurora.org>
Tue, 26 Feb 2019 09:43:03 +0000 (11:43 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 9 Apr 2019 14:11:15 +0000 (17:11 +0300)
commitd42c477cc794163a3757956bbffca5cea000923c
treed35ab93478df1ef4a3860edde915ba845b76f0da
parent3ffeb7d8c896a2280ebaf43d7f9afdc462f14d35
OpenSSL: Use constant time operations for private bignums

This helps in reducing measurable timing differences in operations
involving private information. BoringSSL has removed BN_FLG_CONSTTIME
and expects specific constant time functions to be called instead, so a
bit different approach is needed depending on which library is used.

The main operation that needs protection against side channel attacks is
BN_mod_exp() that depends on private keys (the public key validation
step in crypto_dh_derive_secret() is an exception that can use the
faster version since it does not depend on private keys).

crypto_bignum_div() is currently used only in SAE FFC case with not
safe-prime groups and only with values that do not depend on private
keys, so it is not critical to protect it.

crypto_bignum_inverse() is currently used only in SAE FFC PWE
derivation. The additional protection here is targeting only OpenSSL.
BoringSSL may need conversion to using BN_mod_inverse_blinded().

This is related to CVE-2019-9494 and CVE-2019-9495.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/crypto/crypto_openssl.c