Mercurial > dropbear
diff common-kex.c @ 512:0129fd8ccc71 insecure-nocrypto
Update nocrypto branch to current head
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 06 Nov 2008 13:33:06 +0000 |
parents | 582cb38e4eb5 |
children | a4b7627b3157 |
line wrap: on
line diff
--- a/common-kex.c Thu Nov 06 13:16:55 2008 +0000 +++ b/common-kex.c Thu Nov 06 13:33:06 2008 +0000 @@ -292,44 +292,30 @@ hashkeys(C2S_key, C2S_keysize, &hs, 'C'); hashkeys(S2C_key, S2C_keysize, &hs, 'D'); - recv_cipher = find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name); - if (recv_cipher < 0) - dropbear_exit("crypto error"); - if (ses.newkeys->recv_crypt_mode->start(recv_cipher, - recv_IV, recv_key, - ses.newkeys->recv_algo_crypt->keysize, 0, - &ses.newkeys->recv_cipher_state) != CRYPT_OK) { - dropbear_exit("crypto error"); - } - - trans_cipher = find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name); - if (trans_cipher < 0) - dropbear_exit("crypto error"); - if (ses.newkeys->trans_crypt_mode->start(trans_cipher, - trans_IV, trans_key, - ses.newkeys->trans_algo_crypt->keysize, 0, - &ses.newkeys->trans_cipher_state) != CRYPT_OK) { - dropbear_exit("crypto error"); if (ses.newkeys->recv_algo_crypt->cipherdesc != NULL) { - if (cbc_start( - find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name), + recv_cipher = find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name); + if (recv_cipher < 0) + dropbear_exit("crypto error"); + if (ses.newkeys->recv_crypt_mode->start(recv_cipher, recv_IV, recv_key, ses.newkeys->recv_algo_crypt->keysize, 0, - &ses.newkeys->recv_symmetric_struct) != CRYPT_OK) { + &ses.newkeys->recv_cipher_state) != CRYPT_OK) { dropbear_exit("crypto error"); } } if (ses.newkeys->trans_algo_crypt->cipherdesc != NULL) { - if (cbc_start( - find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name), + trans_cipher = find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name); + if (trans_cipher < 0) + dropbear_exit("crypto error"); + if (ses.newkeys->trans_crypt_mode->start(trans_cipher, trans_IV, trans_key, ses.newkeys->trans_algo_crypt->keysize, 0, - &ses.newkeys->trans_symmetric_struct) != CRYPT_OK) { + &ses.newkeys->trans_cipher_state) != CRYPT_OK) { dropbear_exit("crypto error"); } } - + /* MAC keys */ if (ses.newkeys->trans_algo_mac->hashdesc != NULL) { hashkeys(ses.newkeys->transmackey,