Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: openssl/crypto/ecdsa/ecs_ossl.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « openssl/crypto/ecdsa/ecs_lib.c ('k') | openssl/crypto/engine/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: openssl/crypto/ecdsa/ecs_ossl.c
===================================================================
--- openssl/crypto/ecdsa/ecs_ossl.c (revision 105093)
+++ openssl/crypto/ecdsa/ecs_ossl.c (working copy)
@@ -144,6 +144,14 @@
}
while (BN_is_zero(k));
+ /* We do not want timing information to leak the length of k,
+ * so we compute G*k using an equivalent scalar of fixed
+ * bit-length. */
+
+ if (!BN_add(k, k, order)) goto err;
+ if (BN_num_bits(k) <= BN_num_bits(order))
+ if (!BN_add(k, k, order)) goto err;
+
/* compute r the x-coordinate of generator * k */
if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx))
{
« no previous file with comments | « openssl/crypto/ecdsa/ecs_lib.c ('k') | openssl/crypto/engine/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698