Deleted Added
full compact
monitor.c (192595) monitor.c (197679)
1/* $OpenBSD: monitor.c,v 1.101 2009/02/12 03:26:22 djm Exp $ */
1/* $OpenBSD: monitor.c,v 1.104 2009/06/12 20:43:22 andreas Exp $ */
2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 73 unchanged lines hidden (view full) ---

83#include "ssh-gss.h"
84#endif
85#include "monitor_wrap.h"
86#include "monitor_fdpass.h"
87#include "misc.h"
88#include "compat.h"
89#include "ssh2.h"
90#include "jpake.h"
2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 73 unchanged lines hidden (view full) ---

83#include "ssh-gss.h"
84#endif
85#include "monitor_wrap.h"
86#include "monitor_fdpass.h"
87#include "misc.h"
88#include "compat.h"
89#include "ssh2.h"
90#include "jpake.h"
91#include "roaming.h"
91
92#ifdef GSSAPI
93static Gssctxt *gsscontext = NULL;
94#endif
95
96/* Imports */
97extern ServerOptions options;
98extern u_int utmp_len;
99extern Newkeys *current_keys[];
100extern z_stream incoming_stream;
101extern z_stream outgoing_stream;
102extern u_char session_id[];
92
93#ifdef GSSAPI
94static Gssctxt *gsscontext = NULL;
95#endif
96
97/* Imports */
98extern ServerOptions options;
99extern u_int utmp_len;
100extern Newkeys *current_keys[];
101extern z_stream incoming_stream;
102extern z_stream outgoing_stream;
103extern u_char session_id[];
103extern Buffer input, output;
104extern Buffer auth_debug;
105extern int auth_debug_init;
106extern Buffer loginmsg;
107
108/* State exported from the child */
109
110struct {
111 z_stream incoming;

--- 9 unchanged lines hidden (view full) ---

121 u_char *ssh1key;
122 u_int ssh1keylen;
123 int ssh1cipher;
124 int ssh1protoflags;
125 u_char *input;
126 u_int ilen;
127 u_char *output;
128 u_int olen;
104extern Buffer auth_debug;
105extern int auth_debug_init;
106extern Buffer loginmsg;
107
108/* State exported from the child */
109
110struct {
111 z_stream incoming;

--- 9 unchanged lines hidden (view full) ---

121 u_char *ssh1key;
122 u_int ssh1keylen;
123 int ssh1cipher;
124 int ssh1protoflags;
125 u_char *input;
126 u_int ilen;
127 u_char *output;
128 u_int olen;
129 u_int64_t sent_bytes;
130 u_int64_t recv_bytes;
129} child_state;
130
131/* Functions on the monitor that answer unprivileged requests */
132
133int mm_answer_moduli(int, Buffer *);
134int mm_answer_sign(int, Buffer *);
135int mm_answer_pwnamallow(int, Buffer *);
136int mm_answer_auth2_read_banner(int, Buffer *);

--- 1528 unchanged lines hidden (view full) ---

1665 sizeof(outgoing_stream));
1666
1667 /* Update with new address */
1668 if (options.compression)
1669 mm_init_compression(pmonitor->m_zlib);
1670
1671 /* Network I/O buffers */
1672 /* XXX inefficient for large buffers, need: buffer_init_from_string */
131} child_state;
132
133/* Functions on the monitor that answer unprivileged requests */
134
135int mm_answer_moduli(int, Buffer *);
136int mm_answer_sign(int, Buffer *);
137int mm_answer_pwnamallow(int, Buffer *);
138int mm_answer_auth2_read_banner(int, Buffer *);

--- 1528 unchanged lines hidden (view full) ---

1667 sizeof(outgoing_stream));
1668
1669 /* Update with new address */
1670 if (options.compression)
1671 mm_init_compression(pmonitor->m_zlib);
1672
1673 /* Network I/O buffers */
1674 /* XXX inefficient for large buffers, need: buffer_init_from_string */
1673 buffer_clear(&input);
1674 buffer_append(&input, child_state.input, child_state.ilen);
1675 buffer_clear(packet_get_input());
1676 buffer_append(packet_get_input(), child_state.input, child_state.ilen);
1675 memset(child_state.input, 0, child_state.ilen);
1676 xfree(child_state.input);
1677
1677 memset(child_state.input, 0, child_state.ilen);
1678 xfree(child_state.input);
1679
1678 buffer_clear(&output);
1679 buffer_append(&output, child_state.output, child_state.olen);
1680 buffer_clear(packet_get_output());
1681 buffer_append(packet_get_output(), child_state.output,
1682 child_state.olen);
1680 memset(child_state.output, 0, child_state.olen);
1681 xfree(child_state.output);
1683 memset(child_state.output, 0, child_state.olen);
1684 xfree(child_state.output);
1685
1686 /* Roaming */
1687 if (compat20)
1688 roam_set_bytes(child_state.sent_bytes, child_state.recv_bytes);
1682}
1683
1684static Kex *
1685mm_get_kex(Buffer *m)
1686{
1687 Kex *kex;
1688 void *blob;
1689 u_int bloblen;

--- 99 unchanged lines hidden (view full) ---

1789 memcpy(&child_state.incoming, p, sizeof(child_state.incoming));
1790 xfree(p);
1791
1792 /* Network I/O buffers */
1793 debug3("%s: Getting Network I/O buffers", __func__);
1794 child_state.input = buffer_get_string(&m, &child_state.ilen);
1795 child_state.output = buffer_get_string(&m, &child_state.olen);
1796
1689}
1690
1691static Kex *
1692mm_get_kex(Buffer *m)
1693{
1694 Kex *kex;
1695 void *blob;
1696 u_int bloblen;

--- 99 unchanged lines hidden (view full) ---

1796 memcpy(&child_state.incoming, p, sizeof(child_state.incoming));
1797 xfree(p);
1798
1799 /* Network I/O buffers */
1800 debug3("%s: Getting Network I/O buffers", __func__);
1801 child_state.input = buffer_get_string(&m, &child_state.ilen);
1802 child_state.output = buffer_get_string(&m, &child_state.olen);
1803
1804 /* Roaming */
1805 if (compat20) {
1806 child_state.sent_bytes = buffer_get_int64(&m);
1807 child_state.recv_bytes = buffer_get_int64(&m);
1808 }
1809
1797 buffer_free(&m);
1798}
1799
1800
1801/* Allocation functions for zlib */
1802void *
1803mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
1804{

--- 394 unchanged lines hidden ---
1810 buffer_free(&m);
1811}
1812
1813
1814/* Allocation functions for zlib */
1815void *
1816mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
1817{

--- 394 unchanged lines hidden ---