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 5f608b3b6..a737fce7a 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
@@ -508,7 +508,7 @@ mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp)
508 Enc *enc; 508 Enc *enc;
509 Mac *mac; 509 Mac *mac;
510 Comp *comp; 510 Comp *comp;
511 Newkeys *newkey = newkeys[mode]; 511 Newkeys *newkey = (Newkeys *)packet_get_newkeys(mode);
512 512
513 debug3("%s: converting %p", __func__, newkey); 513 debug3("%s: converting %p", __func__, newkey);
514 514
@@ -570,7 +570,7 @@ mm_send_kex(Buffer *m, Kex *kex)
570void 570void
571mm_send_keystate(struct monitor *monitor) 571mm_send_keystate(struct monitor *monitor)
572{ 572{
573 Buffer m; 573 Buffer m, *input, *output;
574 u_char *blob, *p; 574 u_char *blob, *p;
575 u_int bloblen, plen; 575 u_int bloblen, plen;
576 u_int32_t seqnr, packets; 576 u_int32_t seqnr, packets;
@@ -608,7 +608,8 @@ mm_send_keystate(struct monitor *monitor)
608 } 608 }
609 609
610 debug3("%s: Sending new keys: %p %p", 610 debug3("%s: Sending new keys: %p %p",
611 __func__, newkeys[MODE_OUT], newkeys[MODE_IN]); 611 __func__, packet_get_newkeys(MODE_OUT),
612 packet_get_newkeys(MODE_IN));
612 613
613 /* Keys from Kex */ 614 /* Keys from Kex */
614 if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen)) 615 if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen))
@@ -655,8 +656,16 @@ mm_send_keystate(struct monitor *monitor)
655 buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream)); 656 buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream));
656 657
657 /* Network I/O buffers */ 658 /* Network I/O buffers */
658 buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input)); 659 input = (Buffer *)packet_get_input();
659 buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); 660 output = (Buffer *)packet_get_output();
661 buffer_put_string(&m, buffer_ptr(input), buffer_len(input));
662 buffer_put_string(&m, buffer_ptr(output), buffer_len(output));
663
664 /* Roaming */
665 if (compat20) {
666 buffer_put_int64(&m, get_sent_bytes());
667 buffer_put_int64(&m, get_recv_bytes());
668 }
660 669
661 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m); 670 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
662 debug3("%s: Finished sending state", __func__); 671 debug3("%s: Finished sending state", __func__);
@@ -1327,7 +1336,7 @@ mm_auth2_jpake_get_pwdata(Authctxt *authctxt, BIGNUM **s,
1327} 1336}
1328 1337
1329void 1338void
1330mm_jpake_step1(struct jpake_group *grp, 1339mm_jpake_step1(struct modp_group *grp,
1331 u_char **id, u_int *id_len, 1340 u_char **id, u_int *id_len,
1332 BIGNUM **priv1, BIGNUM **priv2, BIGNUM **g_priv1, BIGNUM **g_priv2, 1341 BIGNUM **priv1, BIGNUM **priv2, BIGNUM **g_priv1, BIGNUM **g_priv2,
1333 u_char **priv1_proof, u_int *priv1_proof_len, 1342 u_char **priv1_proof, u_int *priv1_proof_len,
@@ -1362,7 +1371,7 @@ mm_jpake_step1(struct jpake_group *grp,
1362} 1371}
1363 1372
1364void 1373void
1365mm_jpake_step2(struct jpake_group *grp, BIGNUM *s, 1374mm_jpake_step2(struct modp_group *grp, BIGNUM *s,
1366 BIGNUM *mypub1, BIGNUM *theirpub1, BIGNUM *theirpub2, BIGNUM *mypriv2, 1375 BIGNUM *mypub1, BIGNUM *theirpub1, BIGNUM *theirpub2, BIGNUM *mypriv2,
1367 const u_char *theirid, u_int theirid_len, 1376 const u_char *theirid, u_int theirid_len,
1368 const u_char *myid, u_int myid_len, 1377 const u_char *myid, u_int myid_len,
@@ -1402,7 +1411,7 @@ mm_jpake_step2(struct jpake_group *grp, BIGNUM *s,
1402} 1411}
1403 1412
1404void 1413void
1405mm_jpake_key_confirm(struct jpake_group *grp, BIGNUM *s, BIGNUM *step2_val, 1414mm_jpake_key_confirm(struct modp_group *grp, BIGNUM *s, BIGNUM *step2_val,
1406 BIGNUM *mypriv2, BIGNUM *mypub1, BIGNUM *mypub2, 1415 BIGNUM *mypriv2, BIGNUM *mypub1, BIGNUM *mypub2,
1407 BIGNUM *theirpub1, BIGNUM *theirpub2, 1416 BIGNUM *theirpub1, BIGNUM *theirpub2,
1408 const u_char *my_id, u_int my_id_len, 1417 const u_char *my_id, u_int my_id_len,