comparison common-kex.c @ 415:8b9aba1d5fa4 channel-fix

merge of '73fe066c5d9e2395354ba74756124d45c978a04d' and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Feb 2007 16:00:18 +0000
parents b895f91c2ee6
children 7e43f5e473b9
comparison
equal deleted inserted replaced
414:c53a26c430e5 415:8b9aba1d5fa4
215 215
216 /* Helper function for gen_new_keys, creates a hash. It makes a copy of the 216 /* Helper function for gen_new_keys, creates a hash. It makes a copy of the
217 * already initialised hash_state hs, which should already have processed 217 * already initialised hash_state hs, which should already have processed
218 * the dh_K and hash, since these are common. X is the letter 'A', 'B' etc. 218 * the dh_K and hash, since these are common. X is the letter 'A', 'B' etc.
219 * out must have at least min(SHA1_HASH_SIZE, outlen) bytes allocated. 219 * out must have at least min(SHA1_HASH_SIZE, outlen) bytes allocated.
220 * The output will only be expanded once, since that is all that is required 220 * The output will only be expanded once, as we are assured that
221 * (for 3DES and SHA, with 24 and 20 bytes respectively). 221 * outlen <= 2*SHA1_HASH_SIZE for all known hashes.
222 * 222 *
223 * See Section 5.2 of the IETF secsh Transport Draft for details */ 223 * See Section 7.2 of rfc4253 (ssh transport) for details */
224
225 /* Duplicated verbatim from kex.c --mihnea */
226 static void hashkeys(unsigned char *out, int outlen, 224 static void hashkeys(unsigned char *out, int outlen,
227 const hash_state * hs, const unsigned char X) { 225 const hash_state * hs, const unsigned char X) {
228 226
229 hash_state hs2; 227 hash_state hs2;
230 unsigned char k2[SHA1_HASH_SIZE]; /* used to extending */ 228 unsigned char k2[SHA1_HASH_SIZE]; /* used to extending */