diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-03-29 00:28:09 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-03-29 00:28:09 +0800 |
commit | b4bcc606576dab755441da1bc2fbe28041d54b06 (patch) | |
tree | ef133e658f2c87f8cc154a1a8935f2615a60b475 /algo.h | |
parent | 5139bd42f6700333ddfdcdb125e838d10eeaacf4 (diff) |
More changes for KEX and ECDH. Set up hash descriptors, make ECC code work,
ses.hash and ses.session_id are now buffers (doesn't compile)
--HG--
branch : ecc
Diffstat (limited to 'algo.h')
-rw-r--r-- | algo.h | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -35,8 +35,8 @@ struct Algo_Type { - unsigned char *name; /* identifying name */ - char val; /* a value for this cipher, or -1 for invalid */ + const unsigned char *name; /* identifying name */ + const char val; /* a value for this cipher, or -1 for invalid */ const void *data; /* algorithm specific data */ char usable; /* whether we can use this algorithm */ const void *mode; /* the mode, currently only used for ciphers, @@ -59,8 +59,8 @@ extern const struct dropbear_hash dropbear_nohash; struct dropbear_cipher { const struct ltc_cipher_descriptor *cipherdesc; - unsigned long keysize; - unsigned char blocksize; + const unsigned long keysize; + const unsigned char blocksize; }; struct dropbear_cipher_mode { @@ -75,14 +75,14 @@ struct dropbear_cipher_mode { struct dropbear_hash { const struct ltc_hash_descriptor *hashdesc; - unsigned long keysize; - unsigned char hashsize; + const unsigned long keysize; + const unsigned char hashsize; }; struct dropbear_kex { // "normal" DH KEX - unsigned char *dh_p_bytes; - int dh_p_len; + const unsigned char *dh_p_bytes; + const int dh_p_len; // elliptic curve DH KEX #ifdef DROPBEAR_ECDH @@ -108,14 +108,6 @@ int check_user_algos(const char* user_algo_list, algo_type * algos, char * algolist_string(algo_type algos[]); #endif -enum kex_type { - DROPBEAR_KEX_DH_GROUP1, - DROPBEAR_KEX_DH_GROUP14, - DROPBEAR_KEX_ECDH_SECP256R1, - DROPBEAR_KEX_ECDH_SECP384R1, - DROPBEAR_KEX_ECDH_SECP521R1, -}; - #ifdef DROPBEAR_ECDH #define IS_NORMAL_DH(algo) ((algo)->dh_p_bytes != NULL) #else |