summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/monitor.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2009-10-01 17:12:52 +0000
committerdes <des@FreeBSD.org>2009-10-01 17:12:52 +0000
commitc6a1085feffa5fcd9040272aeae30e7f2466f754 (patch)
tree927d2417c80c4c448ee45c25269ecab7af8f482e /crypto/openssh/monitor.c
parent4f56708582006aca1db129a86ef646499265ee9a (diff)
parent98b8242e22b0fc941b830dcec63d235b01bd46a2 (diff)
downloadFreeBSD-src-c6a1085feffa5fcd9040272aeae30e7f2466f754.zip
FreeBSD-src-c6a1085feffa5fcd9040272aeae30e7f2466f754.tar.gz
Upgrade to OpenSSH 5.3p1.
Diffstat (limited to 'crypto/openssh/monitor.c')
-rw-r--r--crypto/openssh/monitor.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/crypto/openssh/monitor.c b/crypto/openssh/monitor.c
index f57e74b..ace25c4 100644
--- a/crypto/openssh/monitor.c
+++ b/crypto/openssh/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.101 2009/02/12 03:26:22 djm Exp $ */
+/* $OpenBSD: monitor.c,v 1.104 2009/06/12 20:43:22 andreas Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -88,6 +88,7 @@
#include "compat.h"
#include "ssh2.h"
#include "jpake.h"
+#include "roaming.h"
#ifdef GSSAPI
static Gssctxt *gsscontext = NULL;
@@ -100,7 +101,6 @@ extern Newkeys *current_keys[];
extern z_stream incoming_stream;
extern z_stream outgoing_stream;
extern u_char session_id[];
-extern Buffer input, output;
extern Buffer auth_debug;
extern int auth_debug_init;
extern Buffer loginmsg;
@@ -126,6 +126,8 @@ struct {
u_int ilen;
u_char *output;
u_int olen;
+ u_int64_t sent_bytes;
+ u_int64_t recv_bytes;
} child_state;
/* Functions on the monitor that answer unprivileged requests */
@@ -1670,15 +1672,20 @@ monitor_apply_keystate(struct monitor *pmonitor)
/* Network I/O buffers */
/* XXX inefficient for large buffers, need: buffer_init_from_string */
- buffer_clear(&input);
- buffer_append(&input, child_state.input, child_state.ilen);
+ buffer_clear(packet_get_input());
+ buffer_append(packet_get_input(), child_state.input, child_state.ilen);
memset(child_state.input, 0, child_state.ilen);
xfree(child_state.input);
- buffer_clear(&output);
- buffer_append(&output, child_state.output, child_state.olen);
+ buffer_clear(packet_get_output());
+ buffer_append(packet_get_output(), child_state.output,
+ child_state.olen);
memset(child_state.output, 0, child_state.olen);
xfree(child_state.output);
+
+ /* Roaming */
+ if (compat20)
+ roam_set_bytes(child_state.sent_bytes, child_state.recv_bytes);
}
static Kex *
@@ -1794,6 +1801,12 @@ mm_get_keystate(struct monitor *pmonitor)
child_state.input = buffer_get_string(&m, &child_state.ilen);
child_state.output = buffer_get_string(&m, &child_state.olen);
+ /* Roaming */
+ if (compat20) {
+ child_state.sent_bytes = buffer_get_int64(&m);
+ child_state.recv_bytes = buffer_get_int64(&m);
+ }
+
buffer_free(&m);
}
OpenPOWER on IntegriCloud