Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 03e49fc4c1888a94424f977c25155f29 > files > 18

openssl-1.0.0d-2.2.mga1.src.rpm


http://cvs.openssl.org/chngview?cn=20894
http://cvs.openssl.org/chngview?cn=21300
http://cvs.openssl.org/chngview?cn=20898

diff -Naurp openssl-1.0.0d/crypto/ecdsa/ecs_ossl.c openssl-1.0.0d.oden/crypto/ecdsa/ecs_ossl.c
--- openssl-1.0.0d/crypto/ecdsa/ecs_ossl.c	2009-12-01 17:32:33.000000000 +0000
+++ openssl-1.0.0d.oden/crypto/ecdsa/ecs_ossl.c	2011-09-23 11:37:34.000000000 +0000
@@ -144,6 +144,14 @@ static int ecdsa_sign_setup(EC_KEY *ecke
 			}
 		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))
 		{
diff -Naurp openssl-1.0.0d/crypto/ocsp/ocsp_lib.c openssl-1.0.0d.oden/crypto/ocsp/ocsp_lib.c
--- openssl-1.0.0d/crypto/ocsp/ocsp_lib.c	2006-11-13 13:18:28.000000000 +0000
+++ openssl-1.0.0d.oden/crypto/ocsp/ocsp_lib.c	2011-09-23 11:37:38.000000000 +0000
@@ -170,14 +170,14 @@ int OCSP_parse_url(char *url, char **pho
 
 	char *host, *port;
 
-	/* dup the buffer since we are going to mess with it */
-	buf = BUF_strdup(url);
-	if (!buf) goto mem_err;
-
 	*phost = NULL;
 	*pport = NULL;
 	*ppath = NULL;
 
+	/* dup the buffer since we are going to mess with it */
+	buf = BUF_strdup(url);
+	if (!buf) goto mem_err;
+
 	/* Check for initial colon */
 	p = strchr(buf, ':');