File openssl-fips-fix-odd-rsakeybits.patch of Package openssl.4105

Index: openssl-1.0.1i/crypto/rsa/rsa_gen.c
===================================================================
--- openssl-1.0.1i.orig/crypto/rsa/rsa_gen.c
+++ openssl-1.0.1i/crypto/rsa/rsa_gen.c
@@ -424,7 +424,8 @@ static int rsa_builtin_keygen(RSA *rsa,
 	if (r3 == NULL) goto err;
 
 	bitsp=(bits+1)/2;
-	bitsq=bits-bitsp;
+	/* Use the same number of bits for p and q, our checks assume it. */
+	bitsq=bitsp;
 
 	/* prepare a maximum for p and q */
 	/* 0xB504F334 is (sqrt(2)/2)*2^32 */
openSUSE Build Service is sponsored by