]> git.ipfire.org Git - ipfire-3.x.git/blob - openssl/patches/openssl-1.0.0c-rsa-x931.patch
a60bbcb2d957866b4cfc377c1bf318a4146e372c
[ipfire-3.x.git] / openssl / patches / openssl-1.0.0c-rsa-x931.patch
1 diff -up openssl-1.0.0c/apps/genrsa.c.x931 openssl-1.0.0c/apps/genrsa.c
2 --- openssl-1.0.0c/apps/genrsa.c.x931 2010-03-01 15:22:02.000000000 +0100
3 +++ openssl-1.0.0c/apps/genrsa.c 2011-02-01 18:32:05.000000000 +0100
4 @@ -95,6 +95,7 @@ int MAIN(int argc, char **argv)
5 int ret=1;
6 int i,num=DEFBITS;
7 long l;
8 + int use_x931 = 0;
9 const EVP_CIPHER *enc=NULL;
10 unsigned long f4=RSA_F4;
11 char *outfile=NULL;
12 @@ -138,6 +139,8 @@ int MAIN(int argc, char **argv)
13 f4=3;
14 else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
15 f4=RSA_F4;
16 + else if (strcmp(*argv,"-x931") == 0)
17 + use_x931 = 1;
18 #ifndef OPENSSL_NO_ENGINE
19 else if (strcmp(*argv,"-engine") == 0)
20 {
21 @@ -273,7 +276,14 @@ bad:
22 if (!rsa)
23 goto err;
24
25 - if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
26 + if (use_x931)
27 + {
28 + if (!BN_set_word(bn, f4))
29 + goto err;
30 + if (!RSA_X931_generate_key_ex(rsa, num, bn, &cb))
31 + goto err;
32 + }
33 + else if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
34 goto err;
35
36 app_RAND_write_file(NULL, bio_err);