]> git.ipfire.org Git - thirdparty/openssl.git/commit
Ensure we test all parameters for BN_FLG_CONSTTIME
authorMatt Caswell <matt@openssl.org>
Wed, 27 Sep 2017 10:13:47 +0000 (11:13 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 11 Oct 2017 14:55:43 +0000 (15:55 +0100)
commite913d11f444e0b46ec1ebbf3340813693f4d869d
treee6eb5a274b7ff78846e2bd574d939071e28033e2
parentbe9b311b01f79735955ba745a6755e3628b43e46
Ensure we test all parameters for BN_FLG_CONSTTIME

RSA_setup_blinding() calls BN_BLINDING_create_param() which later calls
BN_mod_exp() as follows:

BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx)

ret->mod will have BN_FLG_CONSTTIME set, but ret->e does not. In
BN_mod_exp() we only test the third param for the existence of this flag.
We should test all the inputs.

Thanks to Samuel Weiser (samuel.weiser@iaik.tugraz.at) for reporting this
issue.

This typically only happens once at key load, so this is unlikely to be
exploitable in any real scenario.

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