comparison common-kex.c @ 292:64abb124763d insecure-nocrypto

propagate from branch 'au.asn.ucc.matt.dropbear' (head 7ad1775ed65e75dbece27fe6b65bf1a234db386a) to branch 'au.asn.ucc.matt.dropbear.insecure-nocrypto' (head 88ed2b94d9bfec9a4f661caf592ed01da5eb3b6a)
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Mar 2006 06:30:52 +0000
parents 63601217f5ab 29afa62b5450
children 582cb38e4eb5
comparison
equal deleted inserted replaced
291:55a99934db87 292:64abb124763d
296 hashkeys(C2S_IV, SHA1_HASH_SIZE, &hs, 'A'); 296 hashkeys(C2S_IV, SHA1_HASH_SIZE, &hs, 'A');
297 hashkeys(S2C_IV, SHA1_HASH_SIZE, &hs, 'B'); 297 hashkeys(S2C_IV, SHA1_HASH_SIZE, &hs, 'B');
298 hashkeys(C2S_key, C2S_keysize, &hs, 'C'); 298 hashkeys(C2S_key, C2S_keysize, &hs, 'C');
299 hashkeys(S2C_key, S2C_keysize, &hs, 'D'); 299 hashkeys(S2C_key, S2C_keysize, &hs, 'D');
300 300
301 if (cbc_start( 301 if (ses.newkeys->recv_algo_crypt->cipherdesc != NULL) {
302 find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name), 302 if (cbc_start(
303 recv_IV, recv_key, 303 find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name),
304 ses.newkeys->recv_algo_crypt->keysize, 0, 304 recv_IV, recv_key,
305 &ses.newkeys->recv_symmetric_struct) != CRYPT_OK) { 305 ses.newkeys->recv_algo_crypt->keysize, 0,
306 dropbear_exit("crypto error"); 306 &ses.newkeys->recv_symmetric_struct) != CRYPT_OK) {
307 } 307 dropbear_exit("crypto error");
308 308 }
309 if (cbc_start( 309 }
310 find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name), 310
311 trans_IV, trans_key, 311 if (ses.newkeys->trans_algo_crypt->cipherdesc != NULL) {
312 ses.newkeys->trans_algo_crypt->keysize, 0, 312 if (cbc_start(
313 &ses.newkeys->trans_symmetric_struct) != CRYPT_OK) { 313 find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name),
314 dropbear_exit("crypto error"); 314 trans_IV, trans_key,
315 ses.newkeys->trans_algo_crypt->keysize, 0,
316 &ses.newkeys->trans_symmetric_struct) != CRYPT_OK) {
317 dropbear_exit("crypto error");
318 }
315 } 319 }
316 320
317 /* MAC keys */ 321 /* MAC keys */
318 hashkeys(ses.newkeys->transmackey, 322 if (ses.newkeys->trans_algo_mac->hashdesc != NULL) {
319 ses.newkeys->trans_algo_mac->keysize, &hs, mactransletter); 323 hashkeys(ses.newkeys->transmackey,
320 hashkeys(ses.newkeys->recvmackey, 324 ses.newkeys->trans_algo_mac->keysize, &hs, mactransletter);
321 ses.newkeys->recv_algo_mac->keysize, &hs, macrecvletter); 325 }
326 if (ses.newkeys->recv_algo_mac->hashdesc != NULL) {
327 hashkeys(ses.newkeys->recvmackey,
328 ses.newkeys->recv_algo_mac->keysize, &hs, macrecvletter);
329 }
322 330
323 #ifndef DISABLE_ZLIB 331 #ifndef DISABLE_ZLIB
324 gen_new_zstreams(); 332 gen_new_zstreams();
325 #endif 333 #endif
326 334