comparison common-session.c @ 534:0431915df79f

- 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
author Matt Johnston <matt@ucc.asn.au>
date Sun, 01 Mar 2009 16:15:57 +0000
parents 164b7c2cd5df
children 7de2f22ea759
comparison
equal deleted inserted replaced
533:805ae74ec024 534:0431915df79f
76 76
77 ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN); 77 ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN);
78 ses.transseq = 0; 78 ses.transseq = 0;
79 79
80 ses.readbuf = NULL; 80 ses.readbuf = NULL;
81 ses.decryptreadbuf = NULL;
82 ses.payload = NULL; 81 ses.payload = NULL;
83 ses.recvseq = 0; 82 ses.recvseq = 0;
84 83
85 initqueue(&ses.writequeue); 84 initqueue(&ses.writequeue);
86 85
93 ses.reply_queue_tail = NULL; 92 ses.reply_queue_tail = NULL;
94 93
95 /* set all the algos to none */ 94 /* set all the algos to none */
96 ses.keys = (struct key_context*)m_malloc(sizeof(struct key_context)); 95 ses.keys = (struct key_context*)m_malloc(sizeof(struct key_context));
97 ses.newkeys = NULL; 96 ses.newkeys = NULL;
98 ses.keys->recv_algo_crypt = &dropbear_nocipher; 97 ses.keys->recv.algo_crypt = &dropbear_nocipher;
99 ses.keys->trans_algo_crypt = &dropbear_nocipher; 98 ses.keys->trans.algo_crypt = &dropbear_nocipher;
100 ses.keys->recv_crypt_mode = &dropbear_mode_none; 99 ses.keys->recv.crypt_mode = &dropbear_mode_none;
101 ses.keys->trans_crypt_mode = &dropbear_mode_none; 100 ses.keys->trans.crypt_mode = &dropbear_mode_none;
102 101
103 ses.keys->recv_algo_mac = &dropbear_nohash; 102 ses.keys->recv.algo_mac = &dropbear_nohash;
104 ses.keys->trans_algo_mac = &dropbear_nohash; 103 ses.keys->trans.algo_mac = &dropbear_nohash;
105 104
106 ses.keys->algo_kex = -1; 105 ses.keys->algo_kex = -1;
107 ses.keys->algo_hostkey = -1; 106 ses.keys->algo_hostkey = -1;
108 ses.keys->recv_algo_comp = DROPBEAR_COMP_NONE; 107 ses.keys->recv.algo_comp = DROPBEAR_COMP_NONE;
109 ses.keys->trans_algo_comp = DROPBEAR_COMP_NONE; 108 ses.keys->trans.algo_comp = DROPBEAR_COMP_NONE;
110 109
111 #ifndef DISABLE_ZLIB 110 #ifndef DISABLE_ZLIB
112 ses.keys->recv_zstream = NULL; 111 ses.keys->recv.zstream = NULL;
113 ses.keys->trans_zstream = NULL; 112 ses.keys->trans.zstream = NULL;
114 #endif 113 #endif
115 114
116 /* key exchange buffers */ 115 /* key exchange buffers */
117 ses.session_id = NULL; 116 ses.session_id = NULL;
118 ses.kexhashbuf = NULL; 117 ses.kexhashbuf = NULL;