diff options
-rw-r--r-- | auth2.c | 4 | ||||
-rw-r--r-- | clientloop.c | 4 | ||||
-rw-r--r-- | dispatch.c | 13 | ||||
-rw-r--r-- | dispatch.h | 8 | ||||
-rw-r--r-- | serverloop.c | 4 | ||||
-rw-r--r-- | ssh-keyscan.c | 4 | ||||
-rw-r--r-- | sshconnect2.c | 6 | ||||
-rw-r--r-- | sshd.c | 4 |
8 files changed, 21 insertions, 26 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth2.c,v 1.141 2017/05/31 05:34:14 markus Exp $ */ | 1 | /* $OpenBSD: auth2.c,v 1.142 2017/05/31 07:00:13 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -172,7 +172,7 @@ do_authentication2(Authctxt *authctxt) | |||
172 | ssh->authctxt = authctxt; /* XXX move to caller */ | 172 | ssh->authctxt = authctxt; /* XXX move to caller */ |
173 | ssh_dispatch_init(ssh, &dispatch_protocol_error); | 173 | ssh_dispatch_init(ssh, &dispatch_protocol_error); |
174 | ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_REQUEST, &input_service_request); | 174 | ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_REQUEST, &input_service_request); |
175 | ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success, ssh); | 175 | ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success); |
176 | ssh->authctxt = NULL; | 176 | ssh->authctxt = NULL; |
177 | } | 177 | } |
178 | 178 | ||
diff --git a/clientloop.c b/clientloop.c index 0020637e8..33d6fa908 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.297 2017/05/30 14:23:52 markus Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.298 2017/05/31 07:00:13 markus 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 |
@@ -1167,7 +1167,7 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr, | |||
1167 | static void | 1167 | static void |
1168 | client_process_buffered_input_packets(void) | 1168 | client_process_buffered_input_packets(void) |
1169 | { | 1169 | { |
1170 | dispatch_run(DISPATCH_NONBLOCK, &quit_pending, active_state); | 1170 | ssh_dispatch_run_fatal(active_state, DISPATCH_NONBLOCK, &quit_pending); |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | /* scan buf[] for '~' before sending data to the peer */ | 1173 | /* scan buf[] for '~' before sending data to the peer */ |
diff --git a/dispatch.c b/dispatch.c index 5b2fc41ca..0b3ea614e 100644 --- a/dispatch.c +++ b/dispatch.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dispatch.c,v 1.30 2017/05/30 14:23:52 markus Exp $ */ | 1 | /* $OpenBSD: dispatch.c,v 1.31 2017/05/31 07:00:13 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -85,8 +85,7 @@ ssh_dispatch_set(struct ssh *ssh, int type, dispatch_fn *fn) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | int | 87 | int |
88 | ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done, | 88 | ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done) |
89 | void *ctxt) | ||
90 | { | 89 | { |
91 | int r; | 90 | int r; |
92 | u_char type; | 91 | u_char type; |
@@ -111,8 +110,7 @@ ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done, | |||
111 | ssh->dispatch_skip_packets--; | 110 | ssh->dispatch_skip_packets--; |
112 | continue; | 111 | continue; |
113 | } | 112 | } |
114 | /* XXX 'ssh' will replace 'ctxt' later */ | 113 | r = (*ssh->dispatch[type])(type, seqnr, ssh); |
115 | r = (*ssh->dispatch[type])(type, seqnr, ctxt); | ||
116 | if (r != 0) | 114 | if (r != 0) |
117 | return r; | 115 | return r; |
118 | } else { | 116 | } else { |
@@ -128,11 +126,10 @@ ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done, | |||
128 | } | 126 | } |
129 | 127 | ||
130 | void | 128 | void |
131 | ssh_dispatch_run_fatal(struct ssh *ssh, int mode, volatile sig_atomic_t *done, | 129 | ssh_dispatch_run_fatal(struct ssh *ssh, int mode, volatile sig_atomic_t *done) |
132 | void *ctxt) | ||
133 | { | 130 | { |
134 | int r; | 131 | int r; |
135 | 132 | ||
136 | if ((r = ssh_dispatch_run(ssh, mode, done, ctxt)) != 0) | 133 | if ((r = ssh_dispatch_run(ssh, mode, done)) != 0) |
137 | sshpkt_fatal(ssh, __func__, r); | 134 | sshpkt_fatal(ssh, __func__, r); |
138 | } | 135 | } |
diff --git a/dispatch.h b/dispatch.h index 7dfc74ee3..17a6f3db6 100644 --- a/dispatch.h +++ b/dispatch.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dispatch.h,v 1.13 2017/05/30 14:23:52 markus Exp $ */ | 1 | /* $OpenBSD: dispatch.h,v 1.14 2017/05/31 07:00:13 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -43,8 +43,8 @@ int dispatch_protocol_ignore(int, u_int32_t, struct ssh *); | |||
43 | void ssh_dispatch_init(struct ssh *, dispatch_fn *); | 43 | void ssh_dispatch_init(struct ssh *, dispatch_fn *); |
44 | void ssh_dispatch_set(struct ssh *, int, dispatch_fn *); | 44 | void ssh_dispatch_set(struct ssh *, int, dispatch_fn *); |
45 | void ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *); | 45 | void ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *); |
46 | int ssh_dispatch_run(struct ssh *, int, volatile sig_atomic_t *, void *); | 46 | int ssh_dispatch_run(struct ssh *, int, volatile sig_atomic_t *); |
47 | void ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *, void *); | 47 | void ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *); |
48 | 48 | ||
49 | #define dispatch_init(dflt) \ | 49 | #define dispatch_init(dflt) \ |
50 | ssh_dispatch_init(active_state, (dflt)) | 50 | ssh_dispatch_init(active_state, (dflt)) |
@@ -52,7 +52,5 @@ void ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *, void *); | |||
52 | ssh_dispatch_range(active_state, (from), (to), (fn)) | 52 | ssh_dispatch_range(active_state, (from), (to), (fn)) |
53 | #define dispatch_set(type, fn) \ | 53 | #define dispatch_set(type, fn) \ |
54 | ssh_dispatch_set(active_state, (type), (fn)) | 54 | ssh_dispatch_set(active_state, (type), (fn)) |
55 | #define dispatch_run(mode, done, ctxt) \ | ||
56 | ssh_dispatch_run_fatal(active_state, (mode), (done), (ctxt)) | ||
57 | 55 | ||
58 | #endif | 56 | #endif |
diff --git a/serverloop.c b/serverloop.c index ea07eef23..b5eb3440a 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: serverloop.c,v 1.192 2017/05/30 14:23:52 markus Exp $ */ | 1 | /* $OpenBSD: serverloop.c,v 1.193 2017/05/31 07:00:13 markus 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 |
@@ -323,7 +323,7 @@ process_output(fd_set *writeset, int connection_out) | |||
323 | static void | 323 | static void |
324 | process_buffered_input_packets(void) | 324 | process_buffered_input_packets(void) |
325 | { | 325 | { |
326 | dispatch_run(DISPATCH_NONBLOCK, NULL, active_state); | 326 | ssh_dispatch_run_fatal(active_state, DISPATCH_NONBLOCK, NULL); |
327 | } | 327 | } |
328 | 328 | ||
329 | static void | 329 | static void |
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 7b650d719..2767e7d5f 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keyscan.c,v 1.113 2017/04/30 23:28:42 djm Exp $ */ | 1 | /* $OpenBSD: ssh-keyscan.c,v 1.114 2017/05/31 07:00:13 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. | 3 | * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. |
4 | * | 4 | * |
@@ -271,7 +271,7 @@ keygrab_ssh2(con *c) | |||
271 | * do the key-exchange until an error occurs or until | 271 | * do the key-exchange until an error occurs or until |
272 | * the key_print_wrapper() callback sets c_done. | 272 | * the key_print_wrapper() callback sets c_done. |
273 | */ | 273 | */ |
274 | ssh_dispatch_run(c->c_ssh, DISPATCH_BLOCK, &c->c_done, c->c_ssh); | 274 | ssh_dispatch_run(c->c_ssh, DISPATCH_BLOCK, &c->c_done); |
275 | } | 275 | } |
276 | 276 | ||
277 | static void | 277 | static void |
diff --git a/sshconnect2.c b/sshconnect2.c index ac3dce54c..9b0f845ce 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.262 2017/05/31 05:08:46 djm Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.263 2017/05/31 07:00:13 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2008 Damien Miller. All rights reserved. |
@@ -217,7 +217,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) | |||
217 | kex->server_version_string=server_version_string; | 217 | kex->server_version_string=server_version_string; |
218 | kex->verify_host_key=&verify_host_key_callback; | 218 | kex->verify_host_key=&verify_host_key_callback; |
219 | 219 | ||
220 | dispatch_run(DISPATCH_BLOCK, &kex->done, active_state); | 220 | ssh_dispatch_run_fatal(active_state, DISPATCH_BLOCK, &kex->done); |
221 | 221 | ||
222 | /* remove ext-info from the KEX proposals for rekeying */ | 222 | /* remove ext-info from the KEX proposals for rekeying */ |
223 | myproposal[PROPOSAL_KEX_ALGS] = | 223 | myproposal[PROPOSAL_KEX_ALGS] = |
@@ -401,7 +401,7 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host, | |||
401 | ssh_dispatch_init(ssh, &input_userauth_error); | 401 | ssh_dispatch_init(ssh, &input_userauth_error); |
402 | ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); | 402 | ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); |
403 | ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); | 403 | ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); |
404 | ssh_dispatch_run(ssh, DISPATCH_BLOCK, &authctxt.success, ssh); /* loop until success */ | 404 | ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ |
405 | ssh->authctxt = NULL; | 405 | ssh->authctxt = NULL; |
406 | 406 | ||
407 | pubkey_cleanup(&authctxt); | 407 | pubkey_cleanup(&authctxt); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.488 2017/05/30 08:52:20 markus Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.489 2017/05/31 07:00:13 markus 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 |
@@ -2191,7 +2191,7 @@ do_ssh2_kex(void) | |||
2191 | kex->host_key_index=&get_hostkey_index; | 2191 | kex->host_key_index=&get_hostkey_index; |
2192 | kex->sign = sshd_hostkey_sign; | 2192 | kex->sign = sshd_hostkey_sign; |
2193 | 2193 | ||
2194 | dispatch_run(DISPATCH_BLOCK, &kex->done, active_state); | 2194 | ssh_dispatch_run_fatal(active_state, DISPATCH_BLOCK, &kex->done); |
2195 | 2195 | ||
2196 | session_id2 = kex->session_id; | 2196 | session_id2 = kex->session_id; |
2197 | session_id2_len = kex->session_id_len; | 2197 | session_id2_len = kex->session_id_len; |