diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor.c,v 1.14 2002/06/04 23:05:49 markus Exp $"); | 28 | RCSID("$OpenBSD: monitor.c,v 1.15 2002/06/19 18:01:00 markus Exp $"); |
29 | 29 | ||
30 | #include <openssl/dh.h> | 30 | #include <openssl/dh.h> |
31 | 31 | ||
@@ -83,6 +83,8 @@ struct { | |||
83 | u_int ivinlen; | 83 | u_int ivinlen; |
84 | u_char *ivout; | 84 | u_char *ivout; |
85 | u_int ivoutlen; | 85 | u_int ivoutlen; |
86 | u_char *ssh1key; | ||
87 | u_int ssh1keylen; | ||
86 | int ssh1cipher; | 88 | int ssh1cipher; |
87 | int ssh1protoflags; | 89 | int ssh1protoflags; |
88 | u_char *input; | 90 | u_char *input; |
@@ -1303,14 +1305,13 @@ monitor_apply_keystate(struct monitor *pmonitor) | |||
1303 | set_newkeys(MODE_IN); | 1305 | set_newkeys(MODE_IN); |
1304 | set_newkeys(MODE_OUT); | 1306 | set_newkeys(MODE_OUT); |
1305 | } else { | 1307 | } else { |
1306 | u_char key[SSH_SESSION_KEY_LENGTH]; | ||
1307 | |||
1308 | memset(key, 'a', sizeof(key)); | ||
1309 | packet_set_protocol_flags(child_state.ssh1protoflags); | 1308 | packet_set_protocol_flags(child_state.ssh1protoflags); |
1310 | packet_set_encryption_key(key, SSH_SESSION_KEY_LENGTH, | 1309 | packet_set_encryption_key(child_state.ssh1key, |
1311 | child_state.ssh1cipher); | 1310 | child_state.ssh1keylen, child_state.ssh1cipher); |
1311 | xfree(child_state.ssh1key); | ||
1312 | } | 1312 | } |
1313 | 1313 | ||
1314 | /* for rc4 and other stateful ciphers */ | ||
1314 | packet_set_keycontext(MODE_OUT, child_state.keyout); | 1315 | packet_set_keycontext(MODE_OUT, child_state.keyout); |
1315 | xfree(child_state.keyout); | 1316 | xfree(child_state.keyout); |
1316 | packet_set_keycontext(MODE_IN, child_state.keyin); | 1317 | packet_set_keycontext(MODE_IN, child_state.keyin); |
@@ -1396,6 +1397,8 @@ mm_get_keystate(struct monitor *pmonitor) | |||
1396 | if (!compat20) { | 1397 | if (!compat20) { |
1397 | child_state.ssh1protoflags = buffer_get_int(&m); | 1398 | child_state.ssh1protoflags = buffer_get_int(&m); |
1398 | child_state.ssh1cipher = buffer_get_int(&m); | 1399 | child_state.ssh1cipher = buffer_get_int(&m); |
1400 | child_state.ssh1key = buffer_get_string(&m, | ||
1401 | &child_state.ssh1keylen); | ||
1399 | child_state.ivout = buffer_get_string(&m, | 1402 | child_state.ivout = buffer_get_string(&m, |
1400 | &child_state.ivoutlen); | 1403 | &child_state.ivoutlen); |
1401 | child_state.ivin = buffer_get_string(&m, &child_state.ivinlen); | 1404 | child_state.ivin = buffer_get_string(&m, &child_state.ivinlen); |