summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-05-19 15:05:07 +1000
committerDamien Miller <djm@mindrot.org>2008-05-19 15:05:07 +1000
commitb84886ba3e362f54b70aefcbe1aa10606309b7d7 (patch)
tree9346734369c4e527eca83c87a89c05df0ffe4a18
parentdb255cad0531047a3e35a95af74ad2e03b054412 (diff)
- djm@cvs.openbsd.org 2008/05/08 12:02:23
[auth-options.c auth1.c channels.c channels.h clientloop.c gss-serv.c] [monitor.c monitor_wrap.c nchan.c servconf.c serverloop.c session.c] [ssh.c sshd.c] Implement a channel success/failure status confirmation callback mechanism. Each channel maintains a queue of callbacks, which will be drained in order (RFC4253 guarantees confirm messages are not reordered within an channel). Also includes a abandonment callback to clean up if a channel is closed without sending confirmation messages. This probably shouldn't happen in compliant implementations, but it could be abused to leak memory. ok markus@ (as part of a larger diff)
-rw-r--r--ChangeLog15
-rw-r--r--auth-options.c3
-rw-r--r--auth1.c3
-rw-r--r--channels.c73
-rw-r--r--channels.h26
-rw-r--r--clientloop.c10
-rw-r--r--gss-serv.c3
-rw-r--r--monitor.c3
-rw-r--r--monitor_wrap.c3
-rw-r--r--nchan.c3
-rw-r--r--servconf.c3
-rw-r--r--serverloop.c6
-rw-r--r--session.c3
-rw-r--r--ssh.c6
-rw-r--r--sshd.c3
15 files changed, 132 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index e7fd87ba8..567222e96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,6 +62,19 @@
62 [bufaux.c buffer.h channels.c packet.c packet.h] 62 [bufaux.c buffer.h channels.c packet.c packet.h]
63 avoid extra malloc/copy/free when receiving data over the net; 63 avoid extra malloc/copy/free when receiving data over the net;
64 ~10% speedup for localhost-scp; ok djm@ 64 ~10% speedup for localhost-scp; ok djm@
65 - djm@cvs.openbsd.org 2008/05/08 12:02:23
66 [auth-options.c auth1.c channels.c channels.h clientloop.c gss-serv.c]
67 [monitor.c monitor_wrap.c nchan.c servconf.c serverloop.c session.c]
68 [ssh.c sshd.c]
69 Implement a channel success/failure status confirmation callback
70 mechanism. Each channel maintains a queue of callbacks, which will
71 be drained in order (RFC4253 guarantees confirm messages are not
72 reordered within an channel).
73 Also includes a abandonment callback to clean up if a channel is
74 closed without sending confirmation messages. This probably
75 shouldn't happen in compliant implementations, but it could be
76 abused to leak memory.
77 ok markus@ (as part of a larger diff)
65 78
6620080403 7920080403
67 - (djm) [openbsd-compat/bsd-poll.c] Include stdlib.h to avoid compile- 80 - (djm) [openbsd-compat/bsd-poll.c] Include stdlib.h to avoid compile-
@@ -3922,4 +3935,4 @@
3922 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3935 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3923 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3936 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3924 3937
3925$Id: ChangeLog,v 1.4919 2008/05/19 04:59:37 djm Exp $ 3938$Id: ChangeLog,v 1.4920 2008/05/19 05:05:07 djm Exp $
diff --git a/auth-options.c b/auth-options.c
index 6e2256961..3a6c3c0f3 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.c,v 1.41 2008/03/26 21:28:14 djm Exp $ */ 1/* $OpenBSD: auth-options.c,v 1.42 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -20,6 +20,7 @@
20#include <stdio.h> 20#include <stdio.h>
21#include <stdarg.h> 21#include <stdarg.h>
22 22
23#include "openbsd-compat/sys-queue.h"
23#include "xmalloc.h" 24#include "xmalloc.h"
24#include "match.h" 25#include "match.h"
25#include "log.h" 26#include "log.h"
diff --git a/auth1.c b/auth1.c
index c17cc9133..b5798f634 100644
--- a/auth1.c
+++ b/auth1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth1.c,v 1.71 2007/09/21 08:15:29 djm Exp $ */ 1/* $OpenBSD: auth1.c,v 1.72 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -20,6 +20,7 @@
20#include <unistd.h> 20#include <unistd.h>
21#include <pwd.h> 21#include <pwd.h>
22 22
23#include "openbsd-compat/sys-queue.h"
23#include "xmalloc.h" 24#include "xmalloc.h"
24#include "rsa.h" 25#include "rsa.h"
25#include "ssh1.h" 26#include "ssh1.h"
diff --git a/channels.c b/channels.c
index 05c23e59c..b5e28dabf 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.274 2008/05/08 06:59:01 markus Exp $ */ 1/* $OpenBSD: channels.c,v 1.275 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -61,6 +61,7 @@
61#include <unistd.h> 61#include <unistd.h>
62#include <stdarg.h> 62#include <stdarg.h>
63 63
64#include "openbsd-compat/sys-queue.h"
64#include "xmalloc.h" 65#include "xmalloc.h"
65#include "ssh.h" 66#include "ssh.h"
66#include "ssh1.h" 67#include "ssh1.h"
@@ -319,10 +320,11 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
319 c->single_connection = 0; 320 c->single_connection = 0;
320 c->detach_user = NULL; 321 c->detach_user = NULL;
321 c->detach_close = 0; 322 c->detach_close = 0;
322 c->confirm = NULL; 323 c->open_confirm = NULL;
323 c->confirm_ctx = NULL; 324 c->open_confirm_ctx = NULL;
324 c->input_filter = NULL; 325 c->input_filter = NULL;
325 c->output_filter = NULL; 326 c->output_filter = NULL;
327 TAILQ_INIT(&c->status_confirms);
326 debug("channel %d: new [%s]", found, remote_name); 328 debug("channel %d: new [%s]", found, remote_name);
327 return c; 329 return c;
328} 330}
@@ -379,6 +381,7 @@ channel_free(Channel *c)
379{ 381{
380 char *s; 382 char *s;
381 u_int i, n; 383 u_int i, n;
384 struct channel_confirm *cc;
382 385
383 for (n = 0, i = 0; i < channels_alloc; i++) 386 for (n = 0, i = 0; i < channels_alloc; i++)
384 if (channels[i]) 387 if (channels[i])
@@ -402,6 +405,13 @@ channel_free(Channel *c)
402 xfree(c->remote_name); 405 xfree(c->remote_name);
403 c->remote_name = NULL; 406 c->remote_name = NULL;
404 } 407 }
408 while ((cc = TAILQ_FIRST(&c->status_confirms)) != NULL) {
409 if (cc->abandon_cb != NULL)
410 cc->abandon_cb(c, cc->ctx);
411 TAILQ_REMOVE(&c->status_confirms, cc, entry);
412 bzero(cc, sizeof(*cc));
413 xfree(cc);
414 }
405 channels[c->self] = NULL; 415 channels[c->self] = NULL;
406 xfree(c); 416 xfree(c);
407} 417}
@@ -660,16 +670,33 @@ channel_request_start(int id, char *service, int wantconfirm)
660} 670}
661 671
662void 672void
663channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) 673channel_register_status_confirm(int id, channel_confirm_cb *cb,
674 channel_confirm_abandon_cb *abandon_cb, void *ctx)
675{
676 struct channel_confirm *cc;
677 Channel *c;
678
679 if ((c = channel_lookup(id)) == NULL)
680 fatal("channel_register_expect: %d: bad id", id);
681
682 cc = xmalloc(sizeof(*cc));
683 cc->cb = cb;
684 cc->abandon_cb = abandon_cb;
685 cc->ctx = ctx;
686 TAILQ_INSERT_TAIL(&c->status_confirms, cc, entry);
687}
688
689void
690channel_register_open_confirm(int id, channel_callback_fn *fn, void *ctx)
664{ 691{
665 Channel *c = channel_lookup(id); 692 Channel *c = channel_lookup(id);
666 693
667 if (c == NULL) { 694 if (c == NULL) {
668 logit("channel_register_comfirm: %d: bad id", id); 695 logit("channel_register_open_comfirm: %d: bad id", id);
669 return; 696 return;
670 } 697 }
671 c->confirm = fn; 698 c->open_confirm = fn;
672 c->confirm_ctx = ctx; 699 c->open_confirm_ctx = ctx;
673} 700}
674 701
675void 702void
@@ -2209,9 +2236,9 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
2209 if (compat20) { 2236 if (compat20) {
2210 c->remote_window = packet_get_int(); 2237 c->remote_window = packet_get_int();
2211 c->remote_maxpacket = packet_get_int(); 2238 c->remote_maxpacket = packet_get_int();
2212 if (c->confirm) { 2239 if (c->open_confirm) {
2213 debug2("callback start"); 2240 debug2("callback start");
2214 c->confirm(c->self, c->confirm_ctx); 2241 c->open_confirm(c->self, c->open_confirm_ctx);
2215 debug2("callback done"); 2242 debug2("callback done");
2216 } 2243 }
2217 debug2("channel %d: open confirm rwindow %u rmax %u", c->self, 2244 debug2("channel %d: open confirm rwindow %u rmax %u", c->self,
@@ -2328,6 +2355,34 @@ channel_input_port_open(int type, u_int32_t seq, void *ctxt)
2328 xfree(host); 2355 xfree(host);
2329} 2356}
2330 2357
2358/* ARGSUSED */
2359void
2360channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)
2361{
2362 Channel *c;
2363 struct channel_confirm *cc;
2364 int remote_id;
2365
2366 /* Reset keepalive timeout */
2367 keep_alive_timeouts = 0;
2368
2369 remote_id = packet_get_int();
2370 packet_check_eom();
2371
2372 debug2("channel_input_confirm: type %d id %d", type, remote_id);
2373
2374 if ((c = channel_lookup(remote_id)) == NULL) {
2375 logit("channel_input_success_failure: %d: unknown", remote_id);
2376 return;
2377 }
2378 ;
2379 if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL)
2380 return;
2381 cc->cb(type, c, cc->ctx);
2382 TAILQ_REMOVE(&c->status_confirms, cc, entry);
2383 bzero(cc, sizeof(*cc));
2384 xfree(cc);
2385}
2331 2386
2332/* -- tcp forwarding */ 2387/* -- tcp forwarding */
2333 2388
diff --git a/channels.h b/channels.h
index b632a86af..46cde0309 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.89 2007/06/11 09:14:00 markus Exp $ */ 1/* $OpenBSD: channels.h,v 1.90 2008/05/08 12:02:23 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -64,6 +64,17 @@ typedef void channel_callback_fn(int, void *);
64typedef int channel_infilter_fn(struct Channel *, char *, int); 64typedef int channel_infilter_fn(struct Channel *, char *, int);
65typedef u_char *channel_outfilter_fn(struct Channel *, u_char **, u_int *); 65typedef u_char *channel_outfilter_fn(struct Channel *, u_char **, u_int *);
66 66
67/* Channel success/failure callbacks */
68typedef void channel_confirm_cb(int, struct Channel *, void *);
69typedef void channel_confirm_abandon_cb(struct Channel *, void *);
70struct channel_confirm {
71 TAILQ_ENTRY(channel_confirm) entry;
72 channel_confirm_cb *cb;
73 channel_confirm_abandon_cb *abandon_cb;
74 void *ctx;
75};
76TAILQ_HEAD(channel_confirms, channel_confirm);
77
67struct Channel { 78struct Channel {
68 int type; /* channel type/state */ 79 int type; /* channel type/state */
69 int self; /* my own channel identifier */ 80 int self; /* my own channel identifier */
@@ -104,10 +115,11 @@ struct Channel {
104 char *ctype; /* type */ 115 char *ctype; /* type */
105 116
106 /* callback */ 117 /* callback */
107 channel_callback_fn *confirm; 118 channel_callback_fn *open_confirm;
108 void *confirm_ctx; 119 void *open_confirm_ctx;
109 channel_callback_fn *detach_user; 120 channel_callback_fn *detach_user;
110 int detach_close; 121 int detach_close;
122 struct channel_confirms status_confirms;
111 123
112 /* filter */ 124 /* filter */
113 channel_infilter_fn *input_filter; 125 channel_infilter_fn *input_filter;
@@ -170,8 +182,11 @@ void channel_stop_listening(void);
170void channel_send_open(int); 182void channel_send_open(int);
171void channel_request_start(int, char *, int); 183void channel_request_start(int, char *, int);
172void channel_register_cleanup(int, channel_callback_fn *, int); 184void channel_register_cleanup(int, channel_callback_fn *, int);
173void channel_register_confirm(int, channel_callback_fn *, void *); 185void channel_register_open_confirm(int, channel_callback_fn *, void *);
174void channel_register_filter(int, channel_infilter_fn *, channel_outfilter_fn *); 186void channel_register_filter(int, channel_infilter_fn *,
187 channel_outfilter_fn *);
188void channel_register_status_confirm(int, channel_confirm_cb *,
189 channel_confirm_abandon_cb *, void *);
175void channel_cancel_cleanup(int); 190void channel_cancel_cleanup(int);
176int channel_close_fd(int *); 191int channel_close_fd(int *);
177void channel_send_window_changes(void); 192void channel_send_window_changes(void);
@@ -188,6 +203,7 @@ void channel_input_open_confirmation(int, u_int32_t, void *);
188void channel_input_open_failure(int, u_int32_t, void *); 203void channel_input_open_failure(int, u_int32_t, void *);
189void channel_input_port_open(int, u_int32_t, void *); 204void channel_input_port_open(int, u_int32_t, void *);
190void channel_input_window_adjust(int, u_int32_t, void *); 205void channel_input_window_adjust(int, u_int32_t, void *);
206void channel_input_status_confirm(int, u_int32_t, void *);
191 207
192/* file descriptor handling (read/write) */ 208/* file descriptor handling (read/write) */
193 209
diff --git a/clientloop.c b/clientloop.c
index 8a40bc71e..edd801440 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.188 2008/02/22 20:44:02 dtucker Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.189 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -86,6 +86,7 @@
86#include <pwd.h> 86#include <pwd.h>
87#include <unistd.h> 87#include <unistd.h>
88 88
89#include "openbsd-compat/sys-queue.h"
89#include "xmalloc.h" 90#include "xmalloc.h"
90#include "ssh.h" 91#include "ssh.h"
91#include "ssh1.h" 92#include "ssh1.h"
@@ -700,7 +701,7 @@ client_extra_session2_setup(int id, void *arg)
700 cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env, 701 cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env,
701 client_subsystem_reply); 702 client_subsystem_reply);
702 703
703 c->confirm_ctx = NULL; 704 c->open_confirm_ctx = NULL;
704 buffer_free(&cctx->cmd); 705 buffer_free(&cctx->cmd);
705 xfree(cctx->term); 706 xfree(cctx->term);
706 if (cctx->env != NULL) { 707 if (cctx->env != NULL) {
@@ -940,7 +941,8 @@ client_process_control(fd_set *readset)
940 debug3("%s: channel_new: %d", __func__, c->self); 941 debug3("%s: channel_new: %d", __func__, c->self);
941 942
942 channel_send_open(c->self); 943 channel_send_open(c->self);
943 channel_register_confirm(c->self, client_extra_session2_setup, cctx); 944 channel_register_open_confirm(c->self,
945 client_extra_session2_setup, cctx);
944} 946}
945 947
946static void 948static void
@@ -2068,6 +2070,8 @@ client_init_dispatch_20(void)
2068 dispatch_set(SSH2_MSG_CHANNEL_OPEN_FAILURE, &channel_input_open_failure); 2070 dispatch_set(SSH2_MSG_CHANNEL_OPEN_FAILURE, &channel_input_open_failure);
2069 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &client_input_channel_req); 2071 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &client_input_channel_req);
2070 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust); 2072 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
2073 dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &channel_input_status_confirm);
2074 dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &channel_input_status_confirm);
2071 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &client_input_global_request); 2075 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &client_input_global_request);
2072 2076
2073 /* rekeying */ 2077 /* rekeying */
diff --git a/gss-serv.c b/gss-serv.c
index bc498fd47..2ec7ea19c 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv.c,v 1.21 2007/06/12 08:20:00 djm Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.22 2008/05/08 12:02:23 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -35,6 +35,7 @@
35#include <string.h> 35#include <string.h>
36#include <unistd.h> 36#include <unistd.h>
37 37
38#include "openbsd-compat/sys-queue.h"
38#include "xmalloc.h" 39#include "xmalloc.h"
39#include "buffer.h" 40#include "buffer.h"
40#include "key.h" 41#include "key.h"
diff --git a/monitor.c b/monitor.c
index cc0e0fcac..04f6924b6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.94 2007/10/29 04:08:08 dtucker Exp $ */ 1/* $OpenBSD: monitor.c,v 1.95 2008/05/08 12:02:23 djm 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>
@@ -51,6 +51,7 @@
51 51
52#include <openssl/dh.h> 52#include <openssl/dh.h>
53 53
54#include "openbsd-compat/sys-queue.h"
54#include "xmalloc.h" 55#include "xmalloc.h"
55#include "ssh.h" 56#include "ssh.h"
56#include "key.h" 57#include "key.h"
diff --git a/monitor_wrap.c b/monitor_wrap.c
index e895f1924..72fd5c83c 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.60 2007/10/29 04:08:08 dtucker Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.61 2008/05/08 12:02:23 djm 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>
@@ -41,6 +41,7 @@
41#include <openssl/bn.h> 41#include <openssl/bn.h>
42#include <openssl/dh.h> 42#include <openssl/dh.h>
43 43
44#include "openbsd-compat/sys-queue.h"
44#include "xmalloc.h" 45#include "xmalloc.h"
45#include "ssh.h" 46#include "ssh.h"
46#include "dh.h" 47#include "dh.h"
diff --git a/nchan.c b/nchan.c
index ad461f4af..0d0faddb3 100644
--- a/nchan.c
+++ b/nchan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: nchan.c,v 1.57 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: nchan.c,v 1.58 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -32,6 +32,7 @@
32#include <string.h> 32#include <string.h>
33#include <stdarg.h> 33#include <stdarg.h>
34 34
35#include "openbsd-compat/sys-queue.h"
35#include "ssh1.h" 36#include "ssh1.h"
36#include "ssh2.h" 37#include "ssh2.h"
37#include "buffer.h" 38#include "buffer.h"
diff --git a/servconf.c b/servconf.c
index e6d49099b..b8a968aa3 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.c,v 1.178 2008/05/07 05:49:37 pyr Exp $ */ 1/* $OpenBSD: servconf.c,v 1.179 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -24,6 +24,7 @@
24#include <unistd.h> 24#include <unistd.h>
25#include <stdarg.h> 25#include <stdarg.h>
26 26
27#include "openbsd-compat/sys-queue.h"
27#include "xmalloc.h" 28#include "xmalloc.h"
28#include "ssh.h" 29#include "ssh.h"
29#include "log.h" 30#include "log.h"
diff --git a/serverloop.c b/serverloop.c
index bf3f9c9f0..20991c3ce 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.148 2008/02/22 20:44:02 dtucker Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.149 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -56,6 +56,7 @@
56#include <unistd.h> 56#include <unistd.h>
57#include <stdarg.h> 57#include <stdarg.h>
58 58
59#include "openbsd-compat/sys-queue.h"
59#include "xmalloc.h" 60#include "xmalloc.h"
60#include "packet.h" 61#include "packet.h"
61#include "buffer.h" 62#include "buffer.h"
@@ -1188,8 +1189,9 @@ server_init_dispatch_20(void)
1188 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &server_input_channel_req); 1189 dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &server_input_channel_req);
1189 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust); 1190 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
1190 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request); 1191 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
1192 dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &channel_input_status_confirm);
1193 dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &channel_input_status_confirm);
1191 /* client_alive */ 1194 /* client_alive */
1192 dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &server_input_keep_alive);
1193 dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &server_input_keep_alive); 1195 dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &server_input_keep_alive);
1194 dispatch_set(SSH2_MSG_REQUEST_FAILURE, &server_input_keep_alive); 1196 dispatch_set(SSH2_MSG_REQUEST_FAILURE, &server_input_keep_alive);
1195 /* rekeying */ 1197 /* rekeying */
diff --git a/session.c b/session.c
index 16e455588..ca04a4532 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.235 2008/05/07 05:49:37 pyr Exp $ */ 1/* $OpenBSD: session.c,v 1.236 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -59,6 +59,7 @@
59#include <string.h> 59#include <string.h>
60#include <unistd.h> 60#include <unistd.h>
61 61
62#include "openbsd-compat/sys-queue.h"
62#include "xmalloc.h" 63#include "xmalloc.h"
63#include "ssh.h" 64#include "ssh.h"
64#include "ssh1.h" 65#include "ssh1.h"
diff --git a/ssh.c b/ssh.c
index 2ed76c9a1..b144a7130 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.309 2008/01/19 20:51:26 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.310 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -73,6 +73,7 @@
73#include <openssl/evp.h> 73#include <openssl/evp.h>
74#include <openssl/err.h> 74#include <openssl/err.h>
75#include "openbsd-compat/openssl-compat.h" 75#include "openbsd-compat/openssl-compat.h"
76#include "openbsd-compat/sys-queue.h"
76 77
77#include "xmalloc.h" 78#include "xmalloc.h"
78#include "ssh.h" 79#include "ssh.h"
@@ -1195,7 +1196,8 @@ ssh_session2_open(void)
1195 1196
1196 channel_send_open(c->self); 1197 channel_send_open(c->self);
1197 if (!no_shell_flag) 1198 if (!no_shell_flag)
1198 channel_register_confirm(c->self, ssh_session2_setup, NULL); 1199 channel_register_open_confirm(c->self,
1200 ssh_session2_setup, NULL);
1199 1201
1200 return c->self; 1202 return c->self;
1201} 1203}
diff --git a/sshd.c b/sshd.c
index 796310b03..aefbaaa42 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.356 2008/04/13 00:22:17 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.357 2008/05/08 12:02:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -54,6 +54,7 @@
54# include <sys/time.h> 54# include <sys/time.h>
55#endif 55#endif
56#include "openbsd-compat/sys-tree.h" 56#include "openbsd-compat/sys-tree.h"
57#include "openbsd-compat/sys-queue.h"
57#include <sys/wait.h> 58#include <sys/wait.h>
58 59
59#include <errno.h> 60#include <errno.h>