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)
downloadopenssh-git-402c6cc68170ee63d07c5ff4a081e113b1628445.tar.gz
- 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 e4087462..f7e332d8 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: monitor_wrap.c,v 1.10 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: monitor_wrap.c,v 1.11 2002/06/19 18:01:00 markus Exp $");
#include <openssl/bn.h>
#include <openssl/dh.h>
@@ -520,13 +520,21 @@ mm_send_keystate(struct monitor *pmonitor)
if (!compat20) {
u_char iv[24];
- int ivlen;
+ u_char *key;
+ u_int ivlen, keylen;
buffer_put_int(&m, packet_get_protocol_flags());
buffer_put_int(&m, packet_get_ssh1_cipher());
- debug3("%s: Sending ssh1 IV", __func__);
+ debug3("%s: Sending ssh1 KEY+IV", __func__);
+ keylen = packet_get_encryption_key(NULL);
+ key = xmalloc(keylen+1); /* add 1 if keylen == 0 */
+ keylen = packet_get_encryption_key(key);
+ buffer_put_string(&m, key, keylen);
+ memset(key, 0, keylen);
+ xfree(key);
+
ivlen = packet_get_keyiv_len(MODE_OUT);
packet_get_keyiv(MODE_OUT, iv, ivlen);
buffer_put_string(&m, iv, ivlen);