comparison signkey.h @ 795:7f604f9b3756 ecc

ecdsa is working
author Matt Johnston <matt@ucc.asn.au>
date Fri, 03 May 2013 23:07:48 +0800
parents d386defb5376
children 75509065db53
comparison
equal deleted inserted replaced
794:d386defb5376 795:7f604f9b3756
35 #endif 35 #endif
36 #ifdef DROPBEAR_DSS 36 #ifdef DROPBEAR_DSS
37 DROPBEAR_SIGNKEY_DSS, 37 DROPBEAR_SIGNKEY_DSS,
38 #endif 38 #endif
39 #ifdef DROPBEAR_ECDSA 39 #ifdef DROPBEAR_ECDSA
40 #ifdef DROPBEAR_ECC_256
41 DROPBEAR_SIGNKEY_ECDSA_NISTP256, 40 DROPBEAR_SIGNKEY_ECDSA_NISTP256,
42 #endif
43 #ifdef DROPBEAR_ECC_384
44 DROPBEAR_SIGNKEY_ECDSA_NISTP384, 41 DROPBEAR_SIGNKEY_ECDSA_NISTP384,
45 #endif
46 #ifdef DROPBEAR_ECC_521
47 DROPBEAR_SIGNKEY_ECDSA_NISTP521, 42 DROPBEAR_SIGNKEY_ECDSA_NISTP521,
48 #endif
49 DROPBEAR_SIGNKEY_ECDSA_KEYGEN, // just "ecdsa" for keygen 43 DROPBEAR_SIGNKEY_ECDSA_KEYGEN, // just "ecdsa" for keygen
50 #endif // DROPBEAR_ECDSA 44 #endif // DROPBEAR_ECDSA
51 DROPBEAR_SIGNKEY_NUM_NAMED, 45 DROPBEAR_SIGNKEY_NUM_NAMED,
52 DROPBEAR_SIGNKEY_ANY = 80, 46 DROPBEAR_SIGNKEY_ANY = 80,
53 DROPBEAR_SIGNKEY_NONE = 90, 47 DROPBEAR_SIGNKEY_NONE = 90,
61 SIGNKEY_SOURCE_INVALID, 55 SIGNKEY_SOURCE_INVALID,
62 } signkey_source; 56 } signkey_source;
63 57
64 struct SIGN_key { 58 struct SIGN_key {
65 59
66 int type; /* The type of key (dss or rsa) */ 60 enum signkey_type type;
67 signkey_source source; 61 signkey_source source;
68 char *filename; 62 char *filename;
69 /* the buffer? for encrypted keys, so we can later get
70 * the private key portion */
71 63
72 #ifdef DROPBEAR_DSS 64 #ifdef DROPBEAR_DSS
73 dropbear_dss_key * dsskey; 65 dropbear_dss_key * dsskey;
74 #endif 66 #endif
75 #ifdef DROPBEAR_RSA 67 #ifdef DROPBEAR_RSA
76 dropbear_rsa_key * rsakey; 68 dropbear_rsa_key * rsakey;
77 #endif 69 #endif
78 #ifdef DROPBEAR_ECDSA 70 #ifdef DROPBEAR_ECDSA
79 ecc_key *ecckey; 71 ecc_key * ecckey;
80 #endif 72 #endif
81 }; 73 };
82 74
83 typedef struct SIGN_key sign_key; 75 typedef struct SIGN_key sign_key;
84 76
97 #endif 89 #endif
98 int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen, 90 int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen,
99 const unsigned char* algoname, unsigned int algolen, 91 const unsigned char* algoname, unsigned int algolen,
100 buffer * line, char ** fingerprint); 92 buffer * line, char ** fingerprint);
101 93
94 #ifdef DROPBEAR_ECDSA
95 #define IS_ECDSA_KEY(type) \
96 ((type) == DROPBEAR_SIGNKEY_ECDSA_NISTP256 \
97 || (type) == DROPBEAR_SIGNKEY_ECDSA_NISTP384 \
98 || (type) == DROPBEAR_SIGNKEY_ECDSA_NISTP521 \
99 || (type) == DROPBEAR_SIGNKEY_ECDSA_KEYGEN)
100 #endif
101
102 #endif /* _SIGNKEY_H_ */ 102 #endif /* _SIGNKEY_H_ */