comparison gensignkey.c @ 1295:750ec4ec4cbe

Convert #ifdef to #if, other build changes
author Matt Johnston <matt@ucc.asn.au>
date Wed, 04 May 2016 15:33:40 +0200
parents 2bb4c662d1c2
children 185c14fa504d 8747c2b19152
comparison
equal deleted inserted replaced
1294:56aba7dedbea 1295:750ec4ec4cbe
51 51
52 /* returns 0 on failure */ 52 /* returns 0 on failure */
53 static int get_default_bits(enum signkey_type keytype) 53 static int get_default_bits(enum signkey_type keytype)
54 { 54 {
55 switch (keytype) { 55 switch (keytype) {
56 #ifdef DROPBEAR_RSA 56 #if DROPBEAR_RSA
57 case DROPBEAR_SIGNKEY_RSA: 57 case DROPBEAR_SIGNKEY_RSA:
58 return RSA_DEFAULT_SIZE; 58 return RSA_DEFAULT_SIZE;
59 #endif 59 #endif
60 #ifdef DROPBEAR_DSS 60 #if DROPBEAR_DSS
61 case DROPBEAR_SIGNKEY_DSS: 61 case DROPBEAR_SIGNKEY_DSS:
62 return DSS_DEFAULT_SIZE; 62 return DSS_DEFAULT_SIZE;
63 #endif 63 #endif
64 #ifdef DROPBEAR_ECDSA 64 #if DROPBEAR_ECDSA
65 case DROPBEAR_SIGNKEY_ECDSA_KEYGEN: 65 case DROPBEAR_SIGNKEY_ECDSA_KEYGEN:
66 return ECDSA_DEFAULT_SIZE; 66 return ECDSA_DEFAULT_SIZE;
67 case DROPBEAR_SIGNKEY_ECDSA_NISTP521: 67 case DROPBEAR_SIGNKEY_ECDSA_NISTP521:
68 return 521; 68 return 521;
69 case DROPBEAR_SIGNKEY_ECDSA_NISTP384: 69 case DROPBEAR_SIGNKEY_ECDSA_NISTP384:
90 key = new_sign_key(); 90 key = new_sign_key();
91 91
92 seedrandom(); 92 seedrandom();
93 93
94 switch(keytype) { 94 switch(keytype) {
95 #ifdef DROPBEAR_RSA 95 #if DROPBEAR_RSA
96 case DROPBEAR_SIGNKEY_RSA: 96 case DROPBEAR_SIGNKEY_RSA:
97 key->rsakey = gen_rsa_priv_key(bits); 97 key->rsakey = gen_rsa_priv_key(bits);
98 break; 98 break;
99 #endif 99 #endif
100 #ifdef DROPBEAR_DSS 100 #if DROPBEAR_DSS
101 case DROPBEAR_SIGNKEY_DSS: 101 case DROPBEAR_SIGNKEY_DSS:
102 key->dsskey = gen_dss_priv_key(bits); 102 key->dsskey = gen_dss_priv_key(bits);
103 break; 103 break;
104 #endif 104 #endif
105 #ifdef DROPBEAR_ECDSA 105 #if DROPBEAR_ECDSA
106 case DROPBEAR_SIGNKEY_ECDSA_KEYGEN: 106 case DROPBEAR_SIGNKEY_ECDSA_KEYGEN:
107 case DROPBEAR_SIGNKEY_ECDSA_NISTP521: 107 case DROPBEAR_SIGNKEY_ECDSA_NISTP521:
108 case DROPBEAR_SIGNKEY_ECDSA_NISTP384: 108 case DROPBEAR_SIGNKEY_ECDSA_NISTP384:
109 case DROPBEAR_SIGNKEY_ECDSA_NISTP256: 109 case DROPBEAR_SIGNKEY_ECDSA_NISTP256:
110 { 110 {