diff options
author | Matt Johnston <matt@ucc.asn.au> | 2006-03-10 06:30:52 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2006-03-10 06:30:52 +0000 |
commit | ba869e56010db68e19f5a192ed418f832c97261d (patch) | |
tree | a94270674f97649972076c799a6382b4b4a0e6ea /common-kex.c | |
parent | 46d53c37fa27994d17646e5eb922678a7ed4b3e7 (diff) | |
parent | 1632bd4a18be897a35dc2319fd7d5f220c0963d3 (diff) |
propagate from branch 'au.asn.ucc.matt.dropbear' (head 7ad1775ed65e75dbece27fe6b65bf1a234db386a)
to branch 'au.asn.ucc.matt.dropbear.insecure-nocrypto' (head 88ed2b94d9bfec9a4f661caf592ed01da5eb3b6a)
--HG--
branch : insecure-nocrypto
extra : convert_revision : 2b954d406290e6a2be8eb4a262d3675ac95ac544
Diffstat (limited to 'common-kex.c')
-rw-r--r-- | common-kex.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/common-kex.c b/common-kex.c index 5db8e52..7d6b43f 100644 --- a/common-kex.c +++ b/common-kex.c @@ -298,27 +298,35 @@ void gen_new_keys() { hashkeys(C2S_key, C2S_keysize, &hs, 'C'); hashkeys(S2C_key, S2C_keysize, &hs, 'D'); - if (cbc_start( - find_cipher(ses.newkeys->recv_algo_crypt->cipherdesc->name), - recv_IV, recv_key, - ses.newkeys->recv_algo_crypt->keysize, 0, - &ses.newkeys->recv_symmetric_struct) != 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_IV, recv_key, + ses.newkeys->recv_algo_crypt->keysize, 0, + &ses.newkeys->recv_symmetric_struct) != CRYPT_OK) { + dropbear_exit("crypto error"); + } } - if (cbc_start( - find_cipher(ses.newkeys->trans_algo_crypt->cipherdesc->name), - trans_IV, trans_key, - ses.newkeys->trans_algo_crypt->keysize, 0, - &ses.newkeys->trans_symmetric_struct) != 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_IV, trans_key, + ses.newkeys->trans_algo_crypt->keysize, 0, + &ses.newkeys->trans_symmetric_struct) != CRYPT_OK) { + dropbear_exit("crypto error"); + } } /* MAC keys */ - hashkeys(ses.newkeys->transmackey, - ses.newkeys->trans_algo_mac->keysize, &hs, mactransletter); - hashkeys(ses.newkeys->recvmackey, - ses.newkeys->recv_algo_mac->keysize, &hs, macrecvletter); + if (ses.newkeys->trans_algo_mac->hashdesc != NULL) { + hashkeys(ses.newkeys->transmackey, + ses.newkeys->trans_algo_mac->keysize, &hs, mactransletter); + } + if (ses.newkeys->recv_algo_mac->hashdesc != NULL) { + hashkeys(ses.newkeys->recvmackey, + ses.newkeys->recv_algo_mac->keysize, &hs, macrecvletter); + } #ifndef DISABLE_ZLIB gen_new_zstreams(); |