Mercurial > dropbear
comparison session.h @ 839:33207ed1174b
Merge in ECC
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 21 Oct 2013 22:57:21 +0800 |
parents | 7dcb46da72d9 |
children | 6c69e7df3621 |
comparison
equal
deleted
inserted
replaced
834:e378da7eae5d | 839:33207ed1174b |
---|---|
64 struct key_context_directional { | 64 struct key_context_directional { |
65 const struct dropbear_cipher *algo_crypt; | 65 const struct dropbear_cipher *algo_crypt; |
66 const struct dropbear_cipher_mode *crypt_mode; | 66 const struct dropbear_cipher_mode *crypt_mode; |
67 const struct dropbear_hash *algo_mac; | 67 const struct dropbear_hash *algo_mac; |
68 int hash_index; /* lookup for libtomcrypt */ | 68 int hash_index; /* lookup for libtomcrypt */ |
69 char algo_comp; /* compression */ | 69 int algo_comp; /* compression */ |
70 #ifndef DISABLE_ZLIB | 70 #ifndef DISABLE_ZLIB |
71 z_streamp zstream; | 71 z_streamp zstream; |
72 #endif | 72 #endif |
73 /* actual keys */ | 73 /* actual keys */ |
74 union { | 74 union { |
84 struct key_context { | 84 struct key_context { |
85 | 85 |
86 struct key_context_directional recv; | 86 struct key_context_directional recv; |
87 struct key_context_directional trans; | 87 struct key_context_directional trans; |
88 | 88 |
89 char algo_kex; | 89 const struct dropbear_kex *algo_kex; |
90 char algo_hostkey; | 90 int algo_hostkey; |
91 | 91 |
92 int allow_compress; /* whether compression has started (useful in | 92 int allow_compress; /* whether compression has started (useful in |
93 [email protected] delayed compression case) */ | 93 [email protected] delayed compression case) */ |
94 }; | 94 }; |
95 | 95 |
156 | 156 |
157 /* KEX/encryption related */ | 157 /* KEX/encryption related */ |
158 struct KEXState kexstate; | 158 struct KEXState kexstate; |
159 struct key_context *keys; | 159 struct key_context *keys; |
160 struct key_context *newkeys; | 160 struct key_context *newkeys; |
161 unsigned char *session_id; /* this is the hash from the first kex */ | 161 buffer *session_id; /* this is the hash from the first kex */ |
162 /* The below are used temorarily during kex, are freed after use */ | 162 /* The below are used temporarily during kex, are freed after use */ |
163 mp_int * dh_K; /* SSH_MSG_KEXDH_REPLY and sending SSH_MSH_NEWKEYS */ | 163 mp_int * dh_K; /* SSH_MSG_KEXDH_REPLY and sending SSH_MSH_NEWKEYS */ |
164 unsigned char hash[SHA1_HASH_SIZE]; /* the hash*/ | 164 buffer *hash; /* the session hash */ |
165 buffer* kexhashbuf; /* session hash buffer calculated from various packets*/ | 165 buffer* kexhashbuf; /* session hash buffer calculated from various packets*/ |
166 buffer* transkexinit; /* the kexinit packet we send should be kept so we | 166 buffer* transkexinit; /* the kexinit packet we send should be kept so we |
167 can add it to the hash when generating keys */ | 167 can add it to the hash when generating keys */ |
168 | 168 |
169 /* Enables/disables compression */ | 169 /* Enables/disables compression */ |
239 SESSION_RUNNING | 239 SESSION_RUNNING |
240 } cli_state; | 240 } cli_state; |
241 | 241 |
242 struct clientsession { | 242 struct clientsession { |
243 | 243 |
244 mp_int *dh_e, *dh_x; /* Used during KEX */ | 244 // XXX - move these to kexstate? |
245 int dh_val_algo; /* KEX algorithm corresponding to current dh_e and dh_x */ | 245 struct kex_dh_param *dh_param; |
246 struct kex_ecdh_param *ecdh_param; | |
247 const struct dropbear_kex *param_kex_algo; /* KEX algorithm corresponding to current dh_e and dh_x */ | |
248 | |
246 cli_kex_state kex_state; /* Used for progressing KEX */ | 249 cli_kex_state kex_state; /* Used for progressing KEX */ |
247 cli_state state; /* Used to progress auth/channelsession etc */ | 250 cli_state state; /* Used to progress auth/channelsession etc */ |
248 unsigned donefirstkex : 1; /* Set when we set sentnewkeys, never reset */ | 251 unsigned donefirstkex : 1; /* Set when we set sentnewkeys, never reset */ |
249 | 252 |
250 int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */ | 253 int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */ |