77e51b8384994657507e99558509d40e2cc83505
[openwrt/staging/stintel.git] / package / libs / polarssl / patches / 210-gen_key_config_fix.patch
1 Index: polarssl-1.3.7/programs/pkey/gen_key.c
2 ===================================================================
3 --- polarssl-1.3.7.orig/programs/pkey/gen_key.c 2014-06-01 11:46:58.917399668 +0200
4 +++ polarssl-1.3.7/programs/pkey/gen_key.c 2014-06-01 11:48:18.653397400 +0200
5 @@ -215,7 +215,9 @@
6
7 opt.type = DFL_TYPE;
8 opt.rsa_keysize = DFL_RSA_KEYSIZE;
9 +#if defined(POLARSSL_ECP_C)
10 opt.ec_curve = DFL_EC_CURVE;
11 +#endif
12 opt.filename = DFL_FILENAME;
13 opt.format = DFL_FORMAT;
14 opt.use_dev_random = DFL_USE_DEV_RANDOM;
15 @@ -231,8 +233,10 @@
16 {
17 if( strcmp( q, "rsa" ) == 0 )
18 opt.type = POLARSSL_PK_RSA;
19 +#if defined(POLARSSL_ECP_C)
20 else if( strcmp( q, "ec" ) == 0 )
21 opt.type = POLARSSL_PK_ECKEY;
22 +#endif
23 else
24 goto usage;
25 }
26 @@ -251,12 +255,14 @@
27 if( opt.rsa_keysize < 1024 || opt.rsa_keysize > 8192 )
28 goto usage;
29 }
30 +#if defined(POLARSSL_ECP_C)
31 else if( strcmp( p, "ec_curve" ) == 0 )
32 {
33 if( ( curve_info = ecp_curve_info_from_name( q ) ) == NULL )
34 goto usage;
35 opt.ec_curve = curve_info->grp_id;
36 }
37 +#endif
38 else if( strcmp( p, "filename" ) == 0 )
39 opt.filename = q;
40 else if( strcmp( p, "use_dev_random" ) == 0 )