comparison gensignkey.c @ 1252:3f4af834314d

Merge branch 'fperrad-20151231_indent'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 15 Mar 2016 21:41:22 +0800
parents 2bb4c662d1c2
children 750ec4ec4cbe efad433418c4
comparison
equal deleted inserted replaced
1248:739b3909c499 1252:3f4af834314d
50 } 50 }
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 #ifdef 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 #ifdef 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 #ifdef 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:
70 return 384; 70 return 384;
71 case DROPBEAR_SIGNKEY_ECDSA_NISTP256: 71 case DROPBEAR_SIGNKEY_ECDSA_NISTP256:
72 return 256; 72 return 256;
73 #endif 73 #endif
74 default: 74 default:
75 return 0; 75 return 0;
76 } 76 }
77 } 77 }
78 78
79 int signkey_generate(enum signkey_type keytype, int bits, const char* filename) 79 int signkey_generate(enum signkey_type keytype, int bits, const char* filename)
80 { 80 {
81 sign_key * key = NULL; 81 sign_key * key = NULL;