]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authormarkus@openbsd.org <markus@openbsd.org>
Wed, 31 May 2017 07:00:13 +0000 (07:00 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 1 Jun 2017 04:53:33 +0000 (14:53 +1000)
remove now obsolete ctx from ssh_dispatch_run; ok djm@

Upstream-ID: 9870aabf7f4d71660c31fda91b942b19a8e68d29

auth2.c
clientloop.c
dispatch.c
dispatch.h
serverloop.c
ssh-keyscan.c
sshconnect2.c
sshd.c

diff --git a/auth2.c b/auth2.c
index 14634c992bb01968065a6cf6b40174e35ae21c0c..cb4c2fd5d237a04d7d29ebd14bfd2e84c4a97d2f 100644 (file)
--- a/auth2.c
+++ b/auth2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.141 2017/05/31 05:34:14 markus Exp $ */
+/* $OpenBSD: auth2.c,v 1.142 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -172,7 +172,7 @@ do_authentication2(Authctxt *authctxt)
        ssh->authctxt = authctxt;               /* XXX move to caller */
        ssh_dispatch_init(ssh, &dispatch_protocol_error);
        ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_REQUEST, &input_service_request);
-       ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success, ssh);
+       ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success);
        ssh->authctxt = NULL;
 }
 
index 0020637e864a18e76910190ee25aa8700ea8182c..33d6fa90832ed0fc3a5b3d05c9386d56138ee386 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.297 2017/05/30 14:23:52 markus Exp $ */
+/* $OpenBSD: clientloop.c,v 1.298 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * 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,
 static void
 client_process_buffered_input_packets(void)
 {
-       dispatch_run(DISPATCH_NONBLOCK, &quit_pending, active_state);
+       ssh_dispatch_run_fatal(active_state, DISPATCH_NONBLOCK, &quit_pending);
 }
 
 /* scan buf[] for '~' before sending data to the peer */
index 5b2fc41ca62be71f6a4c450f00ad33071d29ac1c..0b3ea614e1506ad1b2bf5ff3153356cbfe5505a9 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.30 2017/05/30 14:23:52 markus Exp $ */
+/* $OpenBSD: dispatch.c,v 1.31 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -85,8 +85,7 @@ ssh_dispatch_set(struct ssh *ssh, int type, dispatch_fn *fn)
 }
 
 int
-ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done,
-    void *ctxt)
+ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done)
 {
        int r;
        u_char type;
@@ -111,8 +110,7 @@ ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done,
                                ssh->dispatch_skip_packets--;
                                continue;
                        }
-                       /* XXX 'ssh' will replace 'ctxt' later */
-                       r = (*ssh->dispatch[type])(type, seqnr, ctxt);
+                       r = (*ssh->dispatch[type])(type, seqnr, ssh);
                        if (r != 0)
                                return r;
                } else {
@@ -128,11 +126,10 @@ ssh_dispatch_run(struct ssh *ssh, int mode, volatile sig_atomic_t *done,
 }
 
 void
-ssh_dispatch_run_fatal(struct ssh *ssh, int mode, volatile sig_atomic_t *done,
-    void *ctxt)
+ssh_dispatch_run_fatal(struct ssh *ssh, int mode, volatile sig_atomic_t *done)
 {
        int r;
 
-       if ((r = ssh_dispatch_run(ssh, mode, done, ctxt)) != 0)
+       if ((r = ssh_dispatch_run(ssh, mode, done)) != 0)
                sshpkt_fatal(ssh, __func__, r);
 }
index 7dfc74ee34393acc538fe720bb0f09e512736fd4..17a6f3db6338b20426ebfde358f41ca1d8a2cefb 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.h,v 1.13 2017/05/30 14:23:52 markus Exp $ */
+/* $OpenBSD: dispatch.h,v 1.14 2017/05/31 07:00:13 markus Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -43,8 +43,8 @@ int   dispatch_protocol_ignore(int, u_int32_t, struct ssh *);
 void   ssh_dispatch_init(struct ssh *, dispatch_fn *);
 void   ssh_dispatch_set(struct ssh *, int, dispatch_fn *);
 void   ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *);
-int    ssh_dispatch_run(struct ssh *, int, volatile sig_atomic_t *, void *);
-void   ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *, void *);
+int    ssh_dispatch_run(struct ssh *, int, volatile sig_atomic_t *);
+void   ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *);
 
 #define dispatch_init(dflt) \
        ssh_dispatch_init(active_state, (dflt))
@@ -52,7 +52,5 @@ void  ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *, void *);
        ssh_dispatch_range(active_state, (from), (to), (fn))
 #define dispatch_set(type, fn) \
        ssh_dispatch_set(active_state, (type), (fn))
-#define dispatch_run(mode, done, ctxt) \
-       ssh_dispatch_run_fatal(active_state, (mode), (done), (ctxt))
 
 #endif
index ea07eef23be6afbb302ecd334d966fa5fda0dcff..b5eb3440a2c21afb2782780e6cea9f924d0439da 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.192 2017/05/30 14:23:52 markus Exp $ */
+/* $OpenBSD: serverloop.c,v 1.193 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -323,7 +323,7 @@ process_output(fd_set *writeset, int connection_out)
 static void
 process_buffered_input_packets(void)
 {
-       dispatch_run(DISPATCH_NONBLOCK, NULL, active_state);
+       ssh_dispatch_run_fatal(active_state, DISPATCH_NONBLOCK, NULL);
 }
 
 static void
index 7b650d7197d291547f06fc3ea50ff02d95f2710b..2767e7d5fe286d5882b923b3b05c92eef3f461c9 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.113 2017/04/30 23:28:42 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.114 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
  *
@@ -271,7 +271,7 @@ keygrab_ssh2(con *c)
         * do the key-exchange until an error occurs or until
         * the key_print_wrapper() callback sets c_done.
         */
-       ssh_dispatch_run(c->c_ssh, DISPATCH_BLOCK, &c->c_done, c->c_ssh);
+       ssh_dispatch_run(c->c_ssh, DISPATCH_BLOCK, &c->c_done);
 }
 
 static void
index ac3dce54c39be5e130d952179292bbcbf114058a..9b0f845ce6f45898f240beaf77e7ca93dc1c062d 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.262 2017/05/31 05:08:46 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.263 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
@@ -217,7 +217,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
        kex->server_version_string=server_version_string;
        kex->verify_host_key=&verify_host_key_callback;
 
-       dispatch_run(DISPATCH_BLOCK, &kex->done, active_state);
+       ssh_dispatch_run_fatal(active_state, DISPATCH_BLOCK, &kex->done);
 
        /* remove ext-info from the KEX proposals for rekeying */
        myproposal[PROPOSAL_KEX_ALGS] =
@@ -401,7 +401,7 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
        ssh_dispatch_init(ssh, &input_userauth_error);
        ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info);
        ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept);
-       ssh_dispatch_run(ssh, DISPATCH_BLOCK, &authctxt.success, ssh);  /* loop until success */
+       ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */
        ssh->authctxt = NULL;
 
        pubkey_cleanup(&authctxt);
diff --git a/sshd.c b/sshd.c
index b01eb874c8f163ec93f403adc08ef5758dad1c22..aa3729e7d365847f0fb9b8d006355fc769330df9 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.488 2017/05/30 08:52:20 markus Exp $ */
+/* $OpenBSD: sshd.c,v 1.489 2017/05/31 07:00:13 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2191,7 +2191,7 @@ do_ssh2_kex(void)
        kex->host_key_index=&get_hostkey_index;
        kex->sign = sshd_hostkey_sign;
 
-       dispatch_run(DISPATCH_BLOCK, &kex->done, active_state);
+       ssh_dispatch_run_fatal(active_state, DISPATCH_BLOCK, &kex->done);
 
        session_id2 = kex->session_id;
        session_id2_len = kex->session_id_len;