Blame SOURCES/openssl-1.0.0c-rsa-x931.patch

a5ef24
diff -up openssl-1.0.0c/apps/genrsa.c.x931 openssl-1.0.0c/apps/genrsa.c
a5ef24
--- openssl-1.0.0c/apps/genrsa.c.x931	2010-03-01 15:22:02.000000000 +0100
a5ef24
+++ openssl-1.0.0c/apps/genrsa.c	2011-02-01 18:32:05.000000000 +0100
a5ef24
@@ -95,6 +95,7 @@ int MAIN(int argc, char **argv)
a5ef24
 	int ret=1;
a5ef24
 	int i,num=DEFBITS;
a5ef24
 	long l;
a5ef24
+	int use_x931 = 0;
a5ef24
 	const EVP_CIPHER *enc=NULL;
a5ef24
 	unsigned long f4=RSA_F4;
a5ef24
 	char *outfile=NULL;
a5ef24
@@ -138,6 +139,8 @@ int MAIN(int argc, char **argv)
a5ef24
 			f4=3;
a5ef24
 		else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
a5ef24
 			f4=RSA_F4;
a5ef24
+		else if (strcmp(*argv,"-x931") == 0)
a5ef24
+			use_x931 = 1;
a5ef24
 #ifndef OPENSSL_NO_ENGINE
a5ef24
 		else if (strcmp(*argv,"-engine") == 0)
a5ef24
 			{
a5ef24
@@ -273,7 +276,14 @@ bad:
a5ef24
 	if (!rsa)
a5ef24
 		goto err;
a5ef24
 
a5ef24
-	if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
a5ef24
+	if (use_x931)
a5ef24
+		{
a5ef24
+		if (!BN_set_word(bn, f4))
a5ef24
+			goto err;
a5ef24
+		if (!RSA_X931_generate_key_ex(rsa, num, bn, &cb))
a5ef24
+			goto err;
a5ef24
+		}
a5ef24
+	else if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
a5ef24
 		goto err;
a5ef24
 		
a5ef24
 	app_RAND_write_file(NULL, bio_err);