summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-21 00:43:42 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-21 00:43:42 +0000
commit402c6cc68170ee63d07c5ff4a081e113b1628445 (patch)
tree081f2f0e57c333e53c308abbfdce31b6ae3d2006 /monitor_wrap.c
parentcb72e4f6d2cf63cda22484ec90142689fed288f6 (diff)
- markus@cvs.openbsd.org 2002/06/19 18:01:00
[cipher.c monitor.c monitor_wrap.c packet.c packet.h] make the monitor sync the transfer ssh1 session key; transfer keycontext only for RC4 (this is still depends on EVP implementation details and is broken).
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index e40874627..f7e332d8e 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor_wrap.c,v 1.10 2002/06/19 00:27:55 deraadt Exp $"); 28RCSID("$OpenBSD: monitor_wrap.c,v 1.11 2002/06/19 18:01:00 markus Exp $");
29 29
30#include <openssl/bn.h> 30#include <openssl/bn.h>
31#include <openssl/dh.h> 31#include <openssl/dh.h>
@@ -520,13 +520,21 @@ mm_send_keystate(struct monitor *pmonitor)
520 520
521 if (!compat20) { 521 if (!compat20) {
522 u_char iv[24]; 522 u_char iv[24];
523 int ivlen; 523 u_char *key;
524 u_int ivlen, keylen;
524 525
525 buffer_put_int(&m, packet_get_protocol_flags()); 526 buffer_put_int(&m, packet_get_protocol_flags());
526 527
527 buffer_put_int(&m, packet_get_ssh1_cipher()); 528 buffer_put_int(&m, packet_get_ssh1_cipher());
528 529
529 debug3("%s: Sending ssh1 IV", __func__); 530 debug3("%s: Sending ssh1 KEY+IV", __func__);
531 keylen = packet_get_encryption_key(NULL);
532 key = xmalloc(keylen+1); /* add 1 if keylen == 0 */
533 keylen = packet_get_encryption_key(key);
534 buffer_put_string(&m, key, keylen);
535 memset(key, 0, keylen);
536 xfree(key);
537
530 ivlen = packet_get_keyiv_len(MODE_OUT); 538 ivlen = packet_get_keyiv_len(MODE_OUT);
531 packet_get_keyiv(MODE_OUT, iv, ivlen); 539 packet_get_keyiv(MODE_OUT, iv, ivlen);
532 buffer_put_string(&m, iv, ivlen); 540 buffer_put_string(&m, iv, ivlen);