Mercurial > dropbear
comparison common-kex.c @ 410:b895f91c2ee6
merge of 'b1dd3b94e60a07a176dba2b035ac79968595990a'
and 'bcb33fce2fad01a7626598209d43af3571bd86f0'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 04 Feb 2007 10:32:59 +0000 |
parents | 3e098639b05f 0e69e948caba |
children | 7e43f5e473b9 |
comparison
equal
deleted
inserted
replaced
399:a707e6148060 | 410:b895f91c2ee6 |
---|---|
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 */ |