summaryrefslogtreecommitdiffhomepage
path: root/common-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-03-01 16:15:57 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-03-01 16:15:57 +0000
commitff763e40057e5a51e142d0c4a6ffb090da465b78 (patch)
treedb341584ccdfc37492f4d74d2ba6c7fd79579149 /common-session.c
parent8e72bbaa9db050e4a0386f89999ff2131c0afdb6 (diff)
- Get rid of decryptreadbuf, just decrypt in-place with readbuf
- Share make_mac function for both packet creation and validation - Split recv/trans parts of key_context into their own structures --HG-- extra : convert_revision : 043bc598c76ed43625987e6937e32238f7ed6240
Diffstat (limited to 'common-session.c')
-rw-r--r--common-session.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/common-session.c b/common-session.c
index b48d210..3663534 100644
--- a/common-session.c
+++ b/common-session.c
@@ -78,7 +78,6 @@ void common_session_init(int sock_in, int sock_out, char* remotehost) {
ses.transseq = 0;
ses.readbuf = NULL;
- ses.decryptreadbuf = NULL;
ses.payload = NULL;
ses.recvseq = 0;
@@ -95,22 +94,22 @@ void common_session_init(int sock_in, int sock_out, char* remotehost) {
/* set all the algos to none */
ses.keys = (struct key_context*)m_malloc(sizeof(struct key_context));
ses.newkeys = NULL;
- ses.keys->recv_algo_crypt = &dropbear_nocipher;
- ses.keys->trans_algo_crypt = &dropbear_nocipher;
- ses.keys->recv_crypt_mode = &dropbear_mode_none;
- ses.keys->trans_crypt_mode = &dropbear_mode_none;
+ ses.keys->recv.algo_crypt = &dropbear_nocipher;
+ ses.keys->trans.algo_crypt = &dropbear_nocipher;
+ ses.keys->recv.crypt_mode = &dropbear_mode_none;
+ ses.keys->trans.crypt_mode = &dropbear_mode_none;
- ses.keys->recv_algo_mac = &dropbear_nohash;
- ses.keys->trans_algo_mac = &dropbear_nohash;
+ ses.keys->recv.algo_mac = &dropbear_nohash;
+ ses.keys->trans.algo_mac = &dropbear_nohash;
ses.keys->algo_kex = -1;
ses.keys->algo_hostkey = -1;
- ses.keys->recv_algo_comp = DROPBEAR_COMP_NONE;
- ses.keys->trans_algo_comp = DROPBEAR_COMP_NONE;
+ ses.keys->recv.algo_comp = DROPBEAR_COMP_NONE;
+ ses.keys->trans.algo_comp = DROPBEAR_COMP_NONE;
#ifndef DISABLE_ZLIB
- ses.keys->recv_zstream = NULL;
- ses.keys->trans_zstream = NULL;
+ ses.keys->recv.zstream = NULL;
+ ses.keys->trans.zstream = NULL;
#endif
/* key exchange buffers */