summaryrefslogtreecommitdiffhomepage
path: root/common-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'common-session.c')
-rw-r--r--common-session.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/common-session.c b/common-session.c
index f4fa579..ef8e6fa 100644
--- a/common-session.c
+++ b/common-session.c
@@ -103,7 +103,7 @@ void common_session_init(int sock_in, int sock_out) {
ses.keys->recv.algo_mac = &dropbear_nohash;
ses.keys->trans.algo_mac = &dropbear_nohash;
- ses.keys->algo_kex = -1;
+ ses.keys->algo_kex = NULL;
ses.keys->algo_hostkey = -1;
ses.keys->recv.algo_comp = DROPBEAR_COMP_NONE;
ses.keys->trans.algo_comp = DROPBEAR_COMP_NONE;
@@ -235,7 +235,16 @@ void common_session_cleanup() {
return;
}
- m_free(ses.session_id);
+ if (ses.session_id) {
+ buf_burn(ses.session_id);
+ buf_free(ses.session_id);
+ ses.session_id = NULL;
+ }
+ if (ses.hash) {
+ buf_burn(ses.hash);
+ buf_free(ses.hash);
+ ses.hash = NULL;
+ }
m_burn(ses.keys, sizeof(struct key_context));
m_free(ses.keys);