comparison signkey.h @ 794:d386defb5376 ecc

more ecdsa signkey work, not correct
author Matt Johnston <matt@ucc.asn.au>
date Sun, 28 Apr 2013 23:17:43 +0800
parents d1575fdc29a6
children 7f604f9b3756
comparison
equal deleted inserted replaced
793:70625eed40c9 794:d386defb5376
27 27
28 #include "buffer.h" 28 #include "buffer.h"
29 #include "dss.h" 29 #include "dss.h"
30 #include "rsa.h" 30 #include "rsa.h"
31 31
32 enum signkey_type {
33 #ifdef DROPBEAR_RSA
34 DROPBEAR_SIGNKEY_RSA,
35 #endif
36 #ifdef DROPBEAR_DSS
37 DROPBEAR_SIGNKEY_DSS,
38 #endif
39 #ifdef DROPBEAR_ECDSA
40 #ifdef DROPBEAR_ECC_256
41 DROPBEAR_SIGNKEY_ECDSA_NISTP256,
42 #endif
43 #ifdef DROPBEAR_ECC_384
44 DROPBEAR_SIGNKEY_ECDSA_NISTP384,
45 #endif
46 #ifdef DROPBEAR_ECC_521
47 DROPBEAR_SIGNKEY_ECDSA_NISTP521,
48 #endif
49 DROPBEAR_SIGNKEY_ECDSA_KEYGEN, // just "ecdsa" for keygen
50 #endif // DROPBEAR_ECDSA
51 DROPBEAR_SIGNKEY_NUM_NAMED,
52 DROPBEAR_SIGNKEY_ANY = 80,
53 DROPBEAR_SIGNKEY_NONE = 90,
54 };
55
32 56
33 /* Sources for signing keys */ 57 /* Sources for signing keys */
34 typedef enum { 58 typedef enum {
35 SIGNKEY_SOURCE_RAW_FILE, 59 SIGNKEY_SOURCE_RAW_FILE,
36 SIGNKEY_SOURCE_AGENT, 60 SIGNKEY_SOURCE_AGENT,
57 }; 81 };
58 82
59 typedef struct SIGN_key sign_key; 83 typedef struct SIGN_key sign_key;
60 84
61 sign_key * new_sign_key(); 85 sign_key * new_sign_key();
62 const char* signkey_name_from_type(int type, int *namelen); 86 const char* signkey_name_from_type(enum signkey_type type, unsigned int *namelen);
63 int signkey_type_from_name(const char* name, int namelen); 87 enum signkey_type signkey_type_from_name(const char* name, unsigned int namelen);
64 int buf_get_pub_key(buffer *buf, sign_key *key, int *type); 88 int buf_get_pub_key(buffer *buf, sign_key *key, int *type);
65 int buf_get_priv_key(buffer* buf, sign_key *key, int *type); 89 int buf_get_priv_key(buffer* buf, sign_key *key, int *type);
66 void buf_put_pub_key(buffer* buf, sign_key *key, int type); 90 void buf_put_pub_key(buffer* buf, sign_key *key, int type);
67 void buf_put_priv_key(buffer* buf, sign_key *key, int type); 91 void buf_put_priv_key(buffer* buf, sign_key *key, int type);
68 void sign_key_free(sign_key *key); 92 void sign_key_free(sign_key *key);