summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 92e04901d..743e34079 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.64 2008/11/04 08:22:13 djm Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.68 2009/06/22 05:39:28 dtucker Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -71,19 +71,19 @@
71#include "atomicio.h" 71#include "atomicio.h"
72#include "monitor_fdpass.h" 72#include "monitor_fdpass.h"
73#include "misc.h" 73#include "misc.h"
74#include "schnorr.h"
74#include "jpake.h" 75#include "jpake.h"
75 76
76#include "channels.h" 77#include "channels.h"
77#include "session.h" 78#include "session.h"
78#include "servconf.h" 79#include "servconf.h"
80#include "roaming.h"
79 81
80/* Imports */ 82/* Imports */
81extern int compat20; 83extern int compat20;
82extern Newkeys *newkeys[];
83extern z_stream incoming_stream; 84extern z_stream incoming_stream;
84extern z_stream outgoing_stream; 85extern z_stream outgoing_stream;
85extern struct monitor *pmonitor; 86extern struct monitor *pmonitor;
86extern Buffer input, output;
87extern Buffer loginmsg; 87extern Buffer loginmsg;
88extern ServerOptions options; 88extern ServerOptions options;
89 89
@@ -526,7 +526,7 @@ mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp)
526 Enc *enc; 526 Enc *enc;
527 Mac *mac; 527 Mac *mac;
528 Comp *comp; 528 Comp *comp;
529 Newkeys *newkey = newkeys[mode]; 529 Newkeys *newkey = (Newkeys *)packet_get_newkeys(mode);
530 530
531 debug3("%s: converting %p", __func__, newkey); 531 debug3("%s: converting %p", __func__, newkey);
532 532
@@ -588,7 +588,7 @@ mm_send_kex(Buffer *m, Kex *kex)
588void 588void
589mm_send_keystate(struct monitor *monitor) 589mm_send_keystate(struct monitor *monitor)
590{ 590{
591 Buffer m; 591 Buffer m, *input, *output;
592 u_char *blob, *p; 592 u_char *blob, *p;
593 u_int bloblen, plen; 593 u_int bloblen, plen;
594 u_int32_t seqnr, packets; 594 u_int32_t seqnr, packets;
@@ -626,7 +626,8 @@ mm_send_keystate(struct monitor *monitor)
626 } 626 }
627 627
628 debug3("%s: Sending new keys: %p %p", 628 debug3("%s: Sending new keys: %p %p",
629 __func__, newkeys[MODE_OUT], newkeys[MODE_IN]); 629 __func__, packet_get_newkeys(MODE_OUT),
630 packet_get_newkeys(MODE_IN));
630 631
631 /* Keys from Kex */ 632 /* Keys from Kex */
632 if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen)) 633 if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen))
@@ -673,8 +674,16 @@ mm_send_keystate(struct monitor *monitor)
673 buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream)); 674 buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream));
674 675
675 /* Network I/O buffers */ 676 /* Network I/O buffers */
676 buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input)); 677 input = (Buffer *)packet_get_input();
677 buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); 678 output = (Buffer *)packet_get_output();
679 buffer_put_string(&m, buffer_ptr(input), buffer_len(input));
680 buffer_put_string(&m, buffer_ptr(output), buffer_len(output));
681
682 /* Roaming */
683 if (compat20) {
684 buffer_put_int64(&m, get_sent_bytes());
685 buffer_put_int64(&m, get_recv_bytes());
686 }
678 687
679 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m); 688 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
680 debug3("%s: Finished sending state", __func__); 689 debug3("%s: Finished sending state", __func__);
@@ -1345,7 +1354,7 @@ mm_auth2_jpake_get_pwdata(Authctxt *authctxt, BIGNUM **s,
1345} 1354}
1346 1355
1347void 1356void
1348mm_jpake_step1(struct jpake_group *grp, 1357mm_jpake_step1(struct modp_group *grp,
1349 u_char **id, u_int *id_len, 1358 u_char **id, u_int *id_len,
1350 BIGNUM **priv1, BIGNUM **priv2, BIGNUM **g_priv1, BIGNUM **g_priv2, 1359 BIGNUM **priv1, BIGNUM **priv2, BIGNUM **g_priv1, BIGNUM **g_priv2,
1351 u_char **priv1_proof, u_int *priv1_proof_len, 1360 u_char **priv1_proof, u_int *priv1_proof_len,
@@ -1380,7 +1389,7 @@ mm_jpake_step1(struct jpake_group *grp,
1380} 1389}
1381 1390
1382void 1391void
1383mm_jpake_step2(struct jpake_group *grp, BIGNUM *s, 1392mm_jpake_step2(struct modp_group *grp, BIGNUM *s,
1384 BIGNUM *mypub1, BIGNUM *theirpub1, BIGNUM *theirpub2, BIGNUM *mypriv2, 1393 BIGNUM *mypub1, BIGNUM *theirpub1, BIGNUM *theirpub2, BIGNUM *mypriv2,
1385 const u_char *theirid, u_int theirid_len, 1394 const u_char *theirid, u_int theirid_len,
1386 const u_char *myid, u_int myid_len, 1395 const u_char *myid, u_int myid_len,
@@ -1420,7 +1429,7 @@ mm_jpake_step2(struct jpake_group *grp, BIGNUM *s,
1420} 1429}
1421 1430
1422void 1431void
1423mm_jpake_key_confirm(struct jpake_group *grp, BIGNUM *s, BIGNUM *step2_val, 1432mm_jpake_key_confirm(struct modp_group *grp, BIGNUM *s, BIGNUM *step2_val,
1424 BIGNUM *mypriv2, BIGNUM *mypub1, BIGNUM *mypub2, 1433 BIGNUM *mypriv2, BIGNUM *mypub1, BIGNUM *mypub2,
1425 BIGNUM *theirpub1, BIGNUM *theirpub2, 1434 BIGNUM *theirpub1, BIGNUM *theirpub2,
1426 const u_char *my_id, u_int my_id_len, 1435 const u_char *my_id, u_int my_id_len,