boringssl/crypto/rsa
Brian Smith 95b9769340 Fix error handling in |bn_blinding_update|.
The fields of the |bn_blinding_st| are not updated atomically.
Consequently, one field (|A| or |Ai|) might get updated while the
other field (|Ai| or |A|) doesn't get updated, if an error occurs in
the middle of updating. Deal with this by reseting the counter so that
|A| and |Ai| will both get recreated the next time the blinding is
used.

Fix a separate but related issue by resetting the counter to zero after
calling |bn_blinding_create_param| only if |bn_blinding_create_param|
succeeded. Previously, regardless of whether an error occured in
|bn_blinding_create_param|, |b->counter| would get reset to zero. The
consequence of this was that potentially-bad blinding values would get
used 32 times instead of (32 - |b->counter|) times.

Change-Id: I236cdb6120870ef06cba129ed86619f593cbcf3d
Reviewed-on: https://boringssl-review.googlesource.com/7520
Reviewed-by: David Benjamin <davidben@google.com>
2016-03-21 20:26:21 +00:00
..
blinding.c Fix error handling in |bn_blinding_update|. 2016-03-21 20:26:21 +00:00
CMakeLists.txt Add a run_tests target to run all tests. 2015-10-26 20:33:44 +00:00
internal.h Always use |BN_mod_exp_mont|/|BN_mod_exp_mont_consttime| in RSA. 2016-03-08 22:30:19 +00:00
padding.c Make local functions static. 2016-03-20 16:37:58 +00:00
rsa_asn1.c Fix i2d_RSAPrivateKey, i2d_RSAPublicKey memory leaks 2016-03-07 15:48:21 +00:00
rsa_impl.c Check for |BN_CTX_new| failure in |mod_exp|. 2016-03-20 17:09:51 +00:00
rsa_test.cc Refuse to parse RSA pubkeys with invalid exponents. 2015-12-21 23:49:02 +00:00
rsa.c Align with upstream's error strings, take two. 2016-03-15 16:02:12 +00:00