summaryrefslogtreecommitdiff
path: root/signkey.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-05-03 23:07:48 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-05-03 23:07:48 +0800
commit5123549bfccccaa43871481c300ea4d627dcfbda (patch)
tree34f184b86c912633a30c5c2554a07cc1de7ffb54 /signkey.h
parent140e57260018dfb014f828e18dff429b2530ef37 (diff)
downloaddropbear-5123549bfccccaa43871481c300ea4d627dcfbda.tar.gz
ecdsa is working
Diffstat (limited to 'signkey.h')
-rw-r--r--signkey.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/signkey.h b/signkey.h
index 7758d45..61095c7 100644
--- a/signkey.h
+++ b/signkey.h
@@ -37,15 +37,9 @@ enum signkey_type {
DROPBEAR_SIGNKEY_DSS,
#endif
#ifdef DROPBEAR_ECDSA
-#ifdef DROPBEAR_ECC_256
DROPBEAR_SIGNKEY_ECDSA_NISTP256,
-#endif
-#ifdef DROPBEAR_ECC_384
DROPBEAR_SIGNKEY_ECDSA_NISTP384,
-#endif
-#ifdef DROPBEAR_ECC_521
DROPBEAR_SIGNKEY_ECDSA_NISTP521,
-#endif
DROPBEAR_SIGNKEY_ECDSA_KEYGEN, // just "ecdsa" for keygen
#endif // DROPBEAR_ECDSA
DROPBEAR_SIGNKEY_NUM_NAMED,
@@ -63,11 +57,9 @@ typedef enum {
struct SIGN_key {
- int type; /* The type of key (dss or rsa) */
+ enum signkey_type type;
signkey_source source;
char *filename;
- /* the buffer? for encrypted keys, so we can later get
- * the private key portion */
#ifdef DROPBEAR_DSS
dropbear_dss_key * dsskey;
@@ -76,7 +68,7 @@ struct SIGN_key {
dropbear_rsa_key * rsakey;
#endif
#ifdef DROPBEAR_ECDSA
- ecc_key *ecckey;
+ ecc_key * ecckey;
#endif
};
@@ -99,4 +91,12 @@ int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen,
const unsigned char* algoname, unsigned int algolen,
buffer * line, char ** fingerprint);
+#ifdef DROPBEAR_ECDSA
+#define IS_ECDSA_KEY(type) \
+ ((type) == DROPBEAR_SIGNKEY_ECDSA_NISTP256 \
+ || (type) == DROPBEAR_SIGNKEY_ECDSA_NISTP384 \
+ || (type) == DROPBEAR_SIGNKEY_ECDSA_NISTP521 \
+ || (type) == DROPBEAR_SIGNKEY_ECDSA_KEYGEN)
+#endif
+
#endif /* _SIGNKEY_H_ */