summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2019-01-19 21:31:33 +0000
committerDamien Miller <djm@cvs.openbsd.org>2019-01-19 21:31:33 +0000
commit42c30280187544ac337177e16690f3e6712fe255 (patch)
tree49a47acce956c8e22589a3c528bf202c718c87af
parentb126a8bdb9fcd2aa775eed78f85660b26fc4e382 (diff)
begin landing remaining refactoring of packet parsing API, started
almost exactly six years ago. This change stops including the old packet_* API by default and makes each file that requires the old API include it explicitly. We will commit file-by-file refactoring to remove the old API in consistent steps. with & ok markus@
-rw-r--r--usr.bin/ssh/auth.c5
-rw-r--r--usr.bin/ssh/auth2-hostbased.c4
-rw-r--r--usr.bin/ssh/auth2.c5
-rw-r--r--usr.bin/ssh/channels.c5
-rw-r--r--usr.bin/ssh/clientloop.c5
-rw-r--r--usr.bin/ssh/monitor.c5
-rw-r--r--usr.bin/ssh/monitor_wrap.c5
-rw-r--r--usr.bin/ssh/mux.c5
-rw-r--r--usr.bin/ssh/opacket.c3
-rw-r--r--usr.bin/ssh/packet.h6
-rw-r--r--usr.bin/ssh/servconf.c5
-rw-r--r--usr.bin/ssh/serverloop.c5
-rw-r--r--usr.bin/ssh/session.c5
-rw-r--r--usr.bin/ssh/ssh.c5
-rw-r--r--usr.bin/ssh/sshconnect.c5
-rw-r--r--usr.bin/ssh/sshconnect2.c5
-rw-r--r--usr.bin/ssh/sshd.c5
17 files changed, 62 insertions, 21 deletions
diff --git a/usr.bin/ssh/auth.c b/usr.bin/ssh/auth.c
index 72fc2e9cfe0..c7b9097b74a 100644
--- a/usr.bin/ssh/auth.c
+++ b/usr.bin/ssh/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.135 2019/01/17 04:20:53 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.136 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -65,6 +65,9 @@
#include "compat.h"
#include "channels.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* import */
extern ServerOptions options;
extern int use_privsep;
diff --git a/usr.bin/ssh/auth2-hostbased.c b/usr.bin/ssh/auth2-hostbased.c
index fc463d8166d..a79a56c68a4 100644
--- a/usr.bin/ssh/auth2-hostbased.c
+++ b/usr.bin/ssh/auth2-hostbased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-hostbased.c,v 1.38 2018/09/20 03:28:06 djm Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.39 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -50,6 +50,8 @@
#include "ssherr.h"
#include "match.h"
+extern struct ssh *active_state; /* XXX */
+
/* import */
extern ServerOptions options;
extern u_char *session_id2;
diff --git a/usr.bin/ssh/auth2.c b/usr.bin/ssh/auth2.c
index 6d6a7ded391..c4f87e6d0e9 100644
--- a/usr.bin/ssh/auth2.c
+++ b/usr.bin/ssh/auth2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.151 2019/01/17 04:20:53 djm Exp $ */
+/* $OpenBSD: auth2.c,v 1.152 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -57,6 +57,9 @@
#include "ssherr.h"
#include "digest.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* import */
extern ServerOptions options;
extern u_char *session_id2;
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index d13818f0301..4b8680ac602 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.387 2018/12/07 02:31:20 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.388 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -78,6 +78,9 @@
#include "pathnames.h"
#include "match.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* -- agent forwarding */
#define NUM_SOCKS 10
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index 9399d431472..10075fe9293 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.318 2018/09/21 12:46:22 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.319 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -104,6 +104,9 @@
#include "ssherr.h"
#include "hostfile.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* import options */
extern Options options;
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c
index cb43e17432a..4aabe693828 100644
--- a/usr.bin/ssh/monitor.c
+++ b/usr.bin/ssh/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.188 2018/11/16 02:43:56 djm Exp $ */
+/* $OpenBSD: monitor.c,v 1.189 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -81,6 +81,9 @@
#include "match.h"
#include "ssherr.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
#ifdef GSSAPI
static Gssctxt *gsscontext = NULL;
#endif
diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c
index 6bd42bc7f76..0a750733691 100644
--- a/usr.bin/ssh/monitor_wrap.c
+++ b/usr.bin/ssh/monitor_wrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.107 2018/07/20 03:46:34 djm Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.108 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -71,6 +71,9 @@
#include "ssherr.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* Imports */
extern struct monitor *pmonitor;
extern struct sshbuf *loginmsg;
diff --git a/usr.bin/ssh/mux.c b/usr.bin/ssh/mux.c
index a2b6bd6a130..856153f1676 100644
--- a/usr.bin/ssh/mux.c
+++ b/usr.bin/ssh/mux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mux.c,v 1.77 2018/09/26 07:32:44 djm Exp $ */
+/* $OpenBSD: mux.c,v 1.78 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
@@ -55,6 +55,9 @@
#include "clientloop.h"
#include "ssherr.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* from ssh.c */
extern int tty_flag;
extern Options options;
diff --git a/usr.bin/ssh/opacket.c b/usr.bin/ssh/opacket.c
index 92e17a50b68..77857d9c351 100644
--- a/usr.bin/ssh/opacket.c
+++ b/usr.bin/ssh/opacket.c
@@ -1,8 +1,9 @@
-/* $OpenBSD: opacket.c,v 1.7 2017/10/20 01:56:39 djm Exp $ */
+/* $OpenBSD: opacket.c,v 1.8 2019/01/19 21:31:32 djm Exp $ */
/* Written by Markus Friedl. Placed in the public domain. */
#include "ssherr.h"
#include "packet.h"
+#include "opacket.h" /* XXX */
#include "log.h"
struct ssh *active_state, *backup_state;
diff --git a/usr.bin/ssh/packet.h b/usr.bin/ssh/packet.h
index 1c67b9f653a..fd7eda31db7 100644
--- a/usr.bin/ssh/packet.h
+++ b/usr.bin/ssh/packet.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.h,v 1.86 2018/07/09 21:20:26 markus Exp $ */
+/* $OpenBSD: packet.h,v 1.87 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -190,8 +190,4 @@ int sshpkt_get_end(struct ssh *ssh);
void sshpkt_fmt_connection_id(struct ssh *ssh, char *s, size_t l);
const u_char *sshpkt_ptr(struct ssh *, size_t *lenp);
-/* OLD API */
-extern struct ssh *active_state;
-#include "opacket.h"
-
#endif /* PACKET_H */
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c
index 0dd5e237239..42aeb7cca95 100644
--- a/usr.bin/ssh/servconf.c
+++ b/usr.bin/ssh/servconf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: servconf.c,v 1.344 2018/11/19 04:12:32 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.345 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -56,6 +56,9 @@
#include "myproposal.h"
#include "digest.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
static void add_listen_addr(ServerOptions *, const char *,
const char *, int);
static void add_one_listen_addr(ServerOptions *, const char *,
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c
index 380121ab5ca..6e6631a8368 100644
--- a/usr.bin/ssh/serverloop.c
+++ b/usr.bin/ssh/serverloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.209 2018/07/27 05:13:02 dtucker Exp $ */
+/* $OpenBSD: serverloop.c,v 1.210 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -74,6 +74,9 @@
#include "serverloop.h"
#include "ssherr.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
extern ServerOptions options;
/* XXX */
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index b8e60436ebf..7d30105fc2e 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.309 2019/01/17 04:45:09 djm Exp $ */
+/* $OpenBSD: session.c,v 1.310 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -92,6 +92,9 @@
#include <kafs.h>
#endif
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
#define IS_INTERNAL_SFTP(c) \
(!strncmp(c, INTERNAL_SFTP_NAME, sizeof(INTERNAL_SFTP_NAME) - 1) && \
(c[sizeof(INTERNAL_SFTP_NAME) - 1] == '\0' || \
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 5b2572d0a2e..2e6bbda3c87 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.497 2018/12/27 03:25:25 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.498 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -102,6 +102,9 @@
#include "ssh-pkcs11.h"
#endif
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX move here */
+
extern char *__progname;
/* Flag indicating whether debug mode is on. May be set on the command line. */
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 897ccd61dca..2341b144786 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.309 2018/12/27 03:25:25 djm Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.310 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -56,6 +56,9 @@
#include "authfd.h"
#include "kex.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
struct sshkey *previous_host_key = NULL;
static int matching_host_key_dns = 0;
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index ba7a227da41..c865cd92f31 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.292 2019/01/04 03:27:50 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.293 2019/01/19 21:31:32 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -71,6 +71,9 @@
#include "ssh-gss.h"
#endif
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX */
+
/* import */
extern char *client_version_string;
extern char *server_version_string;
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 809251f11d7..cf2e526ab00 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.521 2019/01/17 01:50:24 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.522 2019/01/19 21:31:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -105,6 +105,9 @@
#include "version.h"
#include "ssherr.h"
+#include "opacket.h" /* XXX */
+extern struct ssh *active_state; /* XXX move decl to this file */
+
/* Re-exec fds */
#define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1)
#define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2)