summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog30
-rw-r--r--OVERVIEW3
-rw-r--r--atomicio.c3
-rw-r--r--atomicio.h7
-rw-r--r--auth-bsdauth.c11
-rw-r--r--auth-chall.c8
-rw-r--r--auth-krb5.c11
-rw-r--r--auth-options.c12
-rw-r--r--auth-options.h6
-rw-r--r--auth-passwd.c5
-rw-r--r--auth-rh-rsa.c8
-rw-r--r--auth-rhosts.c6
-rw-r--r--auth-rsa.c11
-rw-r--r--auth-skey.c5
-rw-r--r--auth.c10
-rw-r--r--auth.h11
-rw-r--r--auth1.c8
-rw-r--r--auth2-chall.c9
-rw-r--r--auth2-gss.c14
-rw-r--r--auth2-hostbased.c12
-rw-r--r--auth2-kbdint.c9
-rw-r--r--auth2-none.c10
-rw-r--r--auth2-passwd.c11
-rw-r--r--auth2-pubkey.c12
-rw-r--r--auth2.c10
-rw-r--r--authfd.c7
-rw-r--r--authfd.h4
-rw-r--r--authfile.c6
-rw-r--r--bufaux.c7
-rw-r--r--bufbn.c7
-rw-r--r--buffer.c3
-rw-r--r--buffer.h38
-rw-r--r--canohost.c5
-rw-r--r--channels.c9
-rw-r--r--channels.h4
-rw-r--r--cipher-3des1.c4
-rw-r--r--cipher-bf1.c4
-rw-r--r--cipher-ctr.c6
-rw-r--r--cipher.c5
-rw-r--r--cleanup.c5
-rw-r--r--clientloop.c8
-rw-r--r--compat.c7
-rw-r--r--compress.c6
-rw-r--r--deattack.c8
-rw-r--r--dh.c2
-rw-r--r--dispatch.c6
-rw-r--r--dns.c2
-rw-r--r--dns.h9
-rw-r--r--fatal.c4
-rw-r--r--groupaccess.c5
-rw-r--r--groupaccess.h4
-rw-r--r--gss-genr.c6
-rw-r--r--gss-serv-krb5.c9
-rw-r--r--gss-serv.c10
-rw-r--r--hostfile.c4
-rw-r--r--includes.h3
-rw-r--r--kex.c12
-rw-r--r--kex.h8
-rw-r--r--kexdh.c9
-rw-r--r--kexdhc.c7
-rw-r--r--kexdhs.c9
-rw-r--r--kexgex.c8
-rw-r--r--kexgexc.c7
-rw-r--r--kexgexs.c8
-rw-r--r--key.c6
-rw-r--r--key.h4
-rw-r--r--log.c6
-rw-r--r--log.h8
-rw-r--r--loginrec.c4
-rw-r--r--loginrec.h4
-rw-r--r--mac.c7
-rw-r--r--match.c6
-rw-r--r--md-sha256.c4
-rw-r--r--misc.c6
-rw-r--r--misc.h7
-rw-r--r--moduli.c3
-rw-r--r--monitor.c15
-rw-r--r--monitor_fdpass.c3
-rw-r--r--monitor_mm.c7
-rw-r--r--monitor_mm.h3
-rw-r--r--monitor_wrap.c25
-rw-r--r--monitor_wrap.h10
-rw-r--r--msg.c6
-rw-r--r--nchan.c3
-rw-r--r--openbsd-compat/port-aix.c7
-rw-r--r--openbsd-compat/port-tun.h2
-rw-r--r--packet.c8
-rw-r--r--progressmeter.c3
-rw-r--r--readconf.c7
-rw-r--r--readconf.h4
-rw-r--r--readpass.c2
-rw-r--r--rsa.c6
-rw-r--r--scard.c8
-rw-r--r--scard.h4
-rw-r--r--scp.c3
-rw-r--r--servconf.c8
-rw-r--r--servconf.h4
-rw-r--r--serverloop.c8
-rw-r--r--session.c15
-rw-r--r--session.h6
-rw-r--r--sftp-client.c12
-rw-r--r--sftp-common.c6
-rw-r--r--sftp-common.h7
-rw-r--r--sftp-glob.c4
-rw-r--r--sftp-server.c12
-rw-r--r--sftp.c6
-rw-r--r--ssh-add.c5
-rw-r--r--ssh-agent.c5
-rw-r--r--ssh-dss.c5
-rw-r--r--ssh-gss.h4
-rw-r--r--ssh-keygen.c3
-rw-r--r--ssh-keyscan.c7
-rw-r--r--ssh-keysign.c6
-rw-r--r--ssh-rsa.c6
-rw-r--r--ssh.c7
-rw-r--r--ssh.h16
-rw-r--r--sshconnect.c6
-rw-r--r--sshconnect.h11
-rw-r--r--sshconnect1.c14
-rw-r--r--sshconnect2.c9
-rw-r--r--sshd.c18
-rw-r--r--sshlogin.c4
-rw-r--r--sshlogin.h9
-rw-r--r--sshpty.c7
-rw-r--r--sshpty.h10
-rw-r--r--sshtty.c4
-rw-r--r--ttymodes.c6
-rw-r--r--uidswap.c5
-rw-r--r--uidswap.h11
-rw-r--r--uuencode.c4
-rw-r--r--uuencode.h8
-rw-r--r--xmalloc.c3
-rw-r--r--xmalloc.h7
133 files changed, 584 insertions, 412 deletions
diff --git a/ChangeLog b/ChangeLog
index b955ea8a4..7f48d236e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,34 @@
54 - stevesk@cvs.openbsd.org 2006/08/01 23:36:12 54 - stevesk@cvs.openbsd.org 2006/08/01 23:36:12
55 [authfile.c channels.c progressmeter.c scard.c servconf.c ssh.c] 55 [authfile.c channels.c progressmeter.c scard.c servconf.c ssh.c]
56 clean extra spaces 56 clean extra spaces
57 - deraadt@cvs.openbsd.org 2006/08/03 03:34:42
58 [OVERVIEW atomicio.c atomicio.h auth-bsdauth.c auth-chall.c auth-krb5.c]
59 [auth-options.c auth-options.h auth-passwd.c auth-rh-rsa.c auth-rhosts.c]
60 [auth-rsa.c auth-skey.c auth.c auth.h auth1.c auth2-chall.c auth2-gss.c]
61 [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c ]
62 [auth2-pubkey.c auth2.c authfd.c authfd.h authfile.c bufaux.c bufbn.c]
63 [buffer.c buffer.h canohost.c channels.c channels.h cipher-3des1.c]
64 [cipher-bf1.c cipher-ctr.c cipher.c cleanup.c clientloop.c compat.c]
65 [compress.c deattack.c dh.c dispatch.c dns.c dns.h fatal.c groupaccess.c]
66 [groupaccess.h gss-genr.c gss-serv-krb5.c gss-serv.c hostfile.c kex.c]
67 [kex.h kexdh.c kexdhc.c kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c]
68 [key.h log.c log.h mac.c match.c md-sha256.c misc.c misc.h moduli.c]
69 [monitor.c monitor_fdpass.c monitor_mm.c monitor_mm.h monitor_wrap.c]
70 [monitor_wrap.h msg.c nchan.c packet.c progressmeter.c readconf.c]
71 [readconf.h readpass.c rsa.c scard.c scard.h scp.c servconf.c servconf.h]
72 [serverloop.c session.c session.h sftp-client.c sftp-common.c]
73 [sftp-common.h sftp-glob.c sftp-server.c sftp.c ssh-add.c ssh-agent.c]
74 [ssh-dss.c ssh-gss.h ssh-keygen.c ssh-keyscan.c ssh-keysign.c ssh-rsa.c]
75 [ssh.c ssh.h sshconnect.c sshconnect.h sshconnect1.c sshconnect2.c]
76 [sshd.c sshlogin.c sshlogin.h sshpty.c sshpty.h sshtty.c ttymodes.c]
77 [uidswap.c uidswap.h uuencode.c uuencode.h xmalloc.c xmalloc.h]
78 [loginrec.c loginrec.h openbsd-compat/port-aix.c openbsd-compat/port-tun.h]
79 almost entirely get rid of the culture of ".h files that include .h files"
80 ok djm, sort of ok stevesk
81 makes the pain stop in one easy step
82 NB. portable commit contains everything *except* removing includes.h, as
83 that will take a fair bit more work as we move headers that are required
84 for portability workarounds to defines.h. (also, this step wasn't "easy")
57 85
5820060804 8620060804
59 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent 87 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent
@@ -5124,4 +5152,4 @@
5124 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 5152 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
5125 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 5153 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
5126 5154
5127$Id: ChangeLog,v 1.4451 2006/08/05 01:38:40 djm Exp $ 5155$Id: ChangeLog,v 1.4452 2006/08/05 02:39:39 djm Exp $
diff --git a/OVERVIEW b/OVERVIEW
index 64b6f75fa..2e1cc0ba3 100644
--- a/OVERVIEW
+++ b/OVERVIEW
@@ -162,8 +162,7 @@ these programs.
162 - There are several other files in the distribution that contain 162 - There are several other files in the distribution that contain
163 various auxiliary routines: 163 various auxiliary routines:
164 ssh.h the main header file for ssh (various definitions) 164 ssh.h the main header file for ssh (various definitions)
165 includes.h includes most system headers. Lots of #ifdefs.
166 uidswap.c uid-swapping 165 uidswap.c uid-swapping
167 xmalloc.c "safe" malloc routines 166 xmalloc.c "safe" malloc routines
168 167
169$OpenBSD: OVERVIEW,v 1.10 2006/04/01 05:37:46 djm Exp $ 168$OpenBSD: OVERVIEW,v 1.11 2006/08/03 03:34:41 deraadt Exp $
diff --git a/atomicio.c b/atomicio.c
index 4ff990fd3..f651a292c 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: atomicio.c,v 1.22 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: atomicio.c,v 1.23 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2006 Damien Miller. All rights reserved. 3 * Copyright (c) 2006 Damien Miller. All rights reserved.
4 * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. 4 * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -29,6 +29,7 @@
29#include "includes.h" 29#include "includes.h"
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/uio.h>
32 33
33#include <errno.h> 34#include <errno.h>
34#include <string.h> 35#include <string.h>
diff --git a/atomicio.h b/atomicio.h
index 05b97ab8b..2fcd25d43 100644
--- a/atomicio.h
+++ b/atomicio.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: atomicio.h,v 1.9 2006/07/30 20:15:19 stevesk Exp $ */ 1/* $OpenBSD: atomicio.h,v 1.10 2006/08/03 03:34:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2006 Damien Miller. All rights reserved.
@@ -29,11 +29,6 @@
29#ifndef _ATOMICIO_H 29#ifndef _ATOMICIO_H
30#define _ATOMICIO_H 30#define _ATOMICIO_H
31 31
32#include <sys/types.h>
33#include <sys/uio.h>
34
35#include <unistd.h>
36
37/* 32/*
38 * Ensure all of data on socket comes through. f==read || f==vwrite 33 * Ensure all of data on socket comes through. f==read || f==vwrite
39 */ 34 */
diff --git a/auth-bsdauth.c b/auth-bsdauth.c
index c309e4a11..f718e5d38 100644
--- a/auth-bsdauth.c
+++ b/auth-bsdauth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-bsdauth.c,v 1.9 2006/03/25 13:17:01 djm Exp $ */ 1/* $OpenBSD: auth-bsdauth.c,v 1.10 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -22,12 +22,21 @@
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25
25#include "includes.h" 26#include "includes.h"
26 27
28#include <sys/types.h>
29
27#ifdef BSD_AUTH 30#ifdef BSD_AUTH
28#include "xmalloc.h" 31#include "xmalloc.h"
32#include "key.h"
33#include "hostfile.h"
29#include "auth.h" 34#include "auth.h"
30#include "log.h" 35#include "log.h"
36#include "buffer.h"
37#ifdef GSSAPI
38#include "ssh-gss.h"
39#endif
31#include "monitor_wrap.h" 40#include "monitor_wrap.h"
32 41
33static void * 42static void *
diff --git a/auth-chall.c b/auth-chall.c
index 023e7ee01..9c1079a17 100644
--- a/auth-chall.c
+++ b/auth-chall.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-chall.c,v 1.11 2006/03/25 13:17:01 djm Exp $ */ 1/* $OpenBSD: auth-chall.c,v 1.12 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,9 +25,13 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
30#include "xmalloc.h"
31#include "key.h"
32#include "hostfile.h"
28#include "auth.h" 33#include "auth.h"
29#include "log.h" 34#include "log.h"
30#include "xmalloc.h"
31#include "servconf.h" 35#include "servconf.h"
32 36
33/* limited protocol v1 interface to kbd-interactive authentication */ 37/* limited protocol v1 interface to kbd-interactive authentication */
diff --git a/auth-krb5.c b/auth-krb5.c
index 676b8ab1f..868288126 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-krb5.c,v 1.18 2006/05/06 08:35:40 dtucker Exp $ */ 1/* $OpenBSD: auth-krb5.c,v 1.19 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Kerberos v5 authentication and ticket-passing routines. 3 * Kerberos v5 authentication and ticket-passing routines.
4 * 4 *
@@ -30,13 +30,20 @@
30 30
31#include "includes.h" 31#include "includes.h"
32 32
33#include <sys/types.h>
34#include <pwd.h>
35#include <stdarg.h>
36
37#include "xmalloc.h"
33#include "ssh.h" 38#include "ssh.h"
34#include "ssh1.h" 39#include "ssh1.h"
35#include "packet.h" 40#include "packet.h"
36#include "xmalloc.h"
37#include "log.h" 41#include "log.h"
42#include "buffer.h"
38#include "servconf.h" 43#include "servconf.h"
39#include "uidswap.h" 44#include "uidswap.h"
45#include "key.h"
46#include "hostfile.h"
40#include "auth.h" 47#include "auth.h"
41 48
42#ifdef KRB5 49#ifdef KRB5
diff --git a/auth-options.c b/auth-options.c
index cd904967a..ca5e1c931 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.c,v 1.39 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: auth-options.c,v 1.40 2006/08/03 03:34:41 deraadt 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
@@ -17,17 +17,25 @@
17#include <netdb.h> 17#include <netdb.h>
18#include <pwd.h> 18#include <pwd.h>
19#include <string.h> 19#include <string.h>
20#include <stdio.h>
21#include <stdarg.h>
20 22
21#include "xmalloc.h" 23#include "xmalloc.h"
22#include "match.h" 24#include "match.h"
23#include "log.h" 25#include "log.h"
24#include "canohost.h" 26#include "canohost.h"
27#include "buffer.h"
25#include "channels.h" 28#include "channels.h"
26#include "auth-options.h" 29#include "auth-options.h"
27#include "servconf.h" 30#include "servconf.h"
28#include "misc.h" 31#include "misc.h"
29#include "monitor_wrap.h" 32#include "key.h"
33#include "hostfile.h"
30#include "auth.h" 34#include "auth.h"
35#ifdef GSSAPI
36#include "ssh-gss.h"
37#endif
38#include "monitor_wrap.h"
31 39
32/* Flags set authorized_keys flags */ 40/* Flags set authorized_keys flags */
33int no_port_forwarding_flag = 0; 41int no_port_forwarding_flag = 0;
diff --git a/auth-options.h b/auth-options.h
index cd2b030cd..853f8b517 100644
--- a/auth-options.h
+++ b/auth-options.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.h,v 1.15 2006/07/06 16:03:53 stevesk Exp $ */ 1/* $OpenBSD: auth-options.h,v 1.16 2006/08/03 03:34:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -15,10 +15,6 @@
15#ifndef AUTH_OPTIONS_H 15#ifndef AUTH_OPTIONS_H
16#define AUTH_OPTIONS_H 16#define AUTH_OPTIONS_H
17 17
18#include <sys/types.h>
19
20#include <pwd.h>
21
22/* Linked list of custom environment strings */ 18/* Linked list of custom environment strings */
23struct envstring { 19struct envstring {
24 struct envstring *next; 20 struct envstring *next;
diff --git a/auth-passwd.c b/auth-passwd.c
index f8df17e6a..be6283796 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-passwd.c,v 1.39 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth-passwd.c,v 1.40 2006/08/03 03:34:41 deraadt 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
@@ -43,11 +43,14 @@
43#include <pwd.h> 43#include <pwd.h>
44#include <stdio.h> 44#include <stdio.h>
45#include <string.h> 45#include <string.h>
46#include <stdarg.h>
46 47
47#include "packet.h" 48#include "packet.h"
48#include "buffer.h" 49#include "buffer.h"
49#include "log.h" 50#include "log.h"
50#include "servconf.h" 51#include "servconf.h"
52#include "key.h"
53#include "hostfile.h"
51#include "auth.h" 54#include "auth.h"
52#include "auth-options.h" 55#include "auth-options.h"
53 56
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c
index 8fa21e12c..eca750275 100644
--- a/auth-rh-rsa.c
+++ b/auth-rh-rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-rh-rsa.c,v 1.41 2006/07/06 16:03:53 stevesk Exp $ */ 1/* $OpenBSD: auth-rh-rsa.c,v 1.42 2006/08/03 03:34:41 deraadt 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
@@ -18,17 +18,21 @@
18#include <sys/types.h> 18#include <sys/types.h>
19 19
20#include <pwd.h> 20#include <pwd.h>
21#include <stdarg.h>
21 22
22#include "packet.h" 23#include "packet.h"
23#include "uidswap.h" 24#include "uidswap.h"
24#include "log.h" 25#include "log.h"
26#include "buffer.h"
25#include "servconf.h" 27#include "servconf.h"
26#include "key.h" 28#include "key.h"
27#include "hostfile.h" 29#include "hostfile.h"
28#include "pathnames.h" 30#include "pathnames.h"
29#include "auth.h" 31#include "auth.h"
30#include "canohost.h" 32#include "canohost.h"
31 33#ifdef GSSAPI
34#include "ssh-gss.h"
35#endif
32#include "monitor_wrap.h" 36#include "monitor_wrap.h"
33 37
34/* import */ 38/* import */
diff --git a/auth-rhosts.c b/auth-rhosts.c
index 8dc4ede05..cd0a7967a 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-rhosts.c,v 1.40 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth-rhosts.c,v 1.41 2006/08/03 03:34:41 deraadt 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
@@ -25,13 +25,17 @@
25#include <pwd.h> 25#include <pwd.h>
26#include <stdio.h> 26#include <stdio.h>
27#include <string.h> 27#include <string.h>
28#include <stdarg.h>
28 29
29#include "packet.h" 30#include "packet.h"
31#include "buffer.h"
30#include "uidswap.h" 32#include "uidswap.h"
31#include "pathnames.h" 33#include "pathnames.h"
32#include "log.h" 34#include "log.h"
33#include "servconf.h" 35#include "servconf.h"
34#include "canohost.h" 36#include "canohost.h"
37#include "key.h"
38#include "hostfile.h"
35#include "auth.h" 39#include "auth.h"
36 40
37/* import */ 41/* import */
diff --git a/auth-rsa.c b/auth-rsa.c
index f3e27e9fa..1c66b86a4 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-rsa.c,v 1.70 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth-rsa.c,v 1.71 2006/08/03 03:34:41 deraadt 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
@@ -26,18 +26,23 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <string.h> 27#include <string.h>
28 28
29#include "xmalloc.h"
29#include "rsa.h" 30#include "rsa.h"
30#include "packet.h" 31#include "packet.h"
31#include "xmalloc.h"
32#include "ssh1.h" 32#include "ssh1.h"
33#include "uidswap.h" 33#include "uidswap.h"
34#include "match.h" 34#include "match.h"
35#include "buffer.h"
35#include "auth-options.h" 36#include "auth-options.h"
36#include "pathnames.h" 37#include "pathnames.h"
37#include "log.h" 38#include "log.h"
38#include "servconf.h" 39#include "servconf.h"
39#include "auth.h" 40#include "key.h"
40#include "hostfile.h" 41#include "hostfile.h"
42#include "auth.h"
43#ifdef GSSAPI
44#include "ssh-gss.h"
45#endif
41#include "monitor_wrap.h" 46#include "monitor_wrap.h"
42#include "ssh.h" 47#include "ssh.h"
43#include "misc.h" 48#include "misc.h"
diff --git a/auth-skey.c b/auth-skey.c
index 9c981ec83..d49e59b75 100644
--- a/auth-skey.c
+++ b/auth-skey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-skey.c,v 1.23 2006/03/25 13:17:01 djm Exp $ */ 1/* $OpenBSD: auth-skey.c,v 1.24 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -22,10 +22,13 @@
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25
25#include "includes.h" 26#include "includes.h"
26 27
27#ifdef SKEY 28#ifdef SKEY
28 29
30#include <sys/types.h>
31
29#include <skey.h> 32#include <skey.h>
30 33
31#include "xmalloc.h" 34#include "xmalloc.h"
diff --git a/auth.c b/auth.c
index 88a8e22ef..fba32eb96 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.74 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth.c,v 1.75 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -51,17 +51,21 @@
51#include "match.h" 51#include "match.h"
52#include "groupaccess.h" 52#include "groupaccess.h"
53#include "log.h" 53#include "log.h"
54#include "buffer.h"
54#include "servconf.h" 55#include "servconf.h"
56#include "key.h"
57#include "hostfile.h"
55#include "auth.h" 58#include "auth.h"
56#include "auth-options.h" 59#include "auth-options.h"
57#include "canohost.h" 60#include "canohost.h"
58#include "buffer.h"
59#include "bufaux.h"
60#include "uidswap.h" 61#include "uidswap.h"
61#include "misc.h" 62#include "misc.h"
62#include "bufaux.h" 63#include "bufaux.h"
63#include "packet.h" 64#include "packet.h"
64#include "loginrec.h" 65#include "loginrec.h"
66#ifdef GSSAPI
67#include "ssh-gss.h"
68#endif
65#include "monitor_wrap.h" 69#include "monitor_wrap.h"
66 70
67/* import */ 71/* import */
diff --git a/auth.h b/auth.h
index 2c7499573..26158b9dd 100644
--- a/auth.h
+++ b/auth.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.h,v 1.56 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth.h,v 1.57 2006/08/03 03:34:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -28,14 +28,8 @@
28#ifndef AUTH_H 28#ifndef AUTH_H
29#define AUTH_H 29#define AUTH_H
30 30
31#include <sys/types.h>
32
33#include <signal.h>
34#include <pwd.h>
35#include <signal.h> 31#include <signal.h>
36#include <stdio.h>
37 32
38#include "buffer.h"
39#include <openssl/rsa.h> 33#include <openssl/rsa.h>
40 34
41#ifdef HAVE_LOGIN_CAP 35#ifdef HAVE_LOGIN_CAP
@@ -48,9 +42,6 @@
48#include <krb5.h> 42#include <krb5.h>
49#endif 43#endif
50 44
51#include "key.h"
52#include "hostfile.h"
53
54typedef struct Authctxt Authctxt; 45typedef struct Authctxt Authctxt;
55typedef struct Authmethod Authmethod; 46typedef struct Authmethod Authmethod;
56typedef struct KbdintDevice KbdintDevice; 47typedef struct KbdintDevice KbdintDevice;
diff --git a/auth1.c b/auth1.c
index 2c5585768..34dcf6266 100644
--- a/auth1.c
+++ b/auth1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth1.c,v 1.69 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth1.c,v 1.70 2006/08/03 03:34:41 deraadt 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
@@ -17,6 +17,7 @@
17#include <stdio.h> 17#include <stdio.h>
18#include <string.h> 18#include <string.h>
19#include <unistd.h> 19#include <unistd.h>
20#include <pwd.h>
20 21
21#include "xmalloc.h" 22#include "xmalloc.h"
22#include "rsa.h" 23#include "rsa.h"
@@ -26,10 +27,15 @@
26#include "log.h" 27#include "log.h"
27#include "servconf.h" 28#include "servconf.h"
28#include "compat.h" 29#include "compat.h"
30#include "key.h"
31#include "hostfile.h"
29#include "auth.h" 32#include "auth.h"
30#include "channels.h" 33#include "channels.h"
31#include "session.h" 34#include "session.h"
32#include "uidswap.h" 35#include "uidswap.h"
36#ifdef GSSAPI
37#include "ssh-gss.h"
38#endif
33#include "monitor_wrap.h" 39#include "monitor_wrap.h"
34#include "buffer.h" 40#include "buffer.h"
35 41
diff --git a/auth2-chall.c b/auth2-chall.c
index 89b261e61..8358140b9 100644
--- a/auth2-chall.c
+++ b/auth2-chall.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-chall.c,v 1.29 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth2-chall.c,v 1.30 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * Copyright (c) 2001 Per Allansson. All rights reserved. 4 * Copyright (c) 2001 Per Allansson. All rights reserved.
@@ -23,16 +23,21 @@
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26
26#include "includes.h" 27#include "includes.h"
27 28
29#include <sys/types.h>
30
28#include <stdio.h> 31#include <stdio.h>
29#include <string.h> 32#include <string.h>
30 33
34#include "xmalloc.h"
31#include "ssh2.h" 35#include "ssh2.h"
36#include "key.h"
37#include "hostfile.h"
32#include "auth.h" 38#include "auth.h"
33#include "buffer.h" 39#include "buffer.h"
34#include "packet.h" 40#include "packet.h"
35#include "xmalloc.h"
36#include "dispatch.h" 41#include "dispatch.h"
37#include "log.h" 42#include "log.h"
38#include "servconf.h" 43#include "servconf.h"
diff --git a/auth2-gss.c b/auth2-gss.c
index 03210673b..67144e495 100644
--- a/auth2-gss.c
+++ b/auth2-gss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-gss.c,v 1.14 2006/03/25 22:22:42 djm Exp $ */ 1/* $OpenBSD: auth2-gss.c,v 1.15 2006/08/03 03:34:41 deraadt 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.
@@ -26,18 +26,20 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#ifdef GSSAPI 29#include <sys/types.h>
30 30
31#include "xmalloc.h"
32#include "key.h"
33#include "hostfile.h"
31#include "auth.h" 34#include "auth.h"
32#include "ssh2.h" 35#include "ssh2.h"
33#include "xmalloc.h"
34#include "log.h" 36#include "log.h"
35#include "dispatch.h" 37#include "dispatch.h"
38#include "buffer.h"
36#include "servconf.h" 39#include "servconf.h"
37#include "packet.h" 40#include "packet.h"
38#include "monitor_wrap.h"
39
40#include "ssh-gss.h" 41#include "ssh-gss.h"
42#include "monitor_wrap.h"
41 43
42extern ServerOptions options; 44extern ServerOptions options;
43 45
@@ -291,5 +293,3 @@ Authmethod method_gssapi = {
291 userauth_gssapi, 293 userauth_gssapi,
292 &options.gss_authentication 294 &options.gss_authentication
293}; 295};
294
295#endif /* GSSAPI */
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 5cb617e1c..663dec5d9 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-hostbased.c,v 1.10 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: auth2-hostbased.c,v 1.11 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -29,18 +29,22 @@
29 29
30#include <pwd.h> 30#include <pwd.h>
31#include <string.h> 31#include <string.h>
32#include <stdarg.h>
32 33
33#include "ssh2.h"
34#include "xmalloc.h" 34#include "xmalloc.h"
35#include "ssh2.h"
35#include "packet.h" 36#include "packet.h"
36#include "buffer.h" 37#include "buffer.h"
37#include "log.h" 38#include "log.h"
38#include "servconf.h" 39#include "servconf.h"
39#include "compat.h" 40#include "compat.h"
40#include "bufaux.h"
41#include "auth.h"
42#include "key.h" 41#include "key.h"
42#include "hostfile.h"
43#include "auth.h"
43#include "canohost.h" 44#include "canohost.h"
45#ifdef GSSAPI
46#include "ssh-gss.h"
47#endif
44#include "monitor_wrap.h" 48#include "monitor_wrap.h"
45#include "pathnames.h" 49#include "pathnames.h"
46 50
diff --git a/auth2-kbdint.c b/auth2-kbdint.c
index 796714eec..901596484 100644
--- a/auth2-kbdint.c
+++ b/auth2-kbdint.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-kbdint.c,v 1.4 2006/03/25 13:17:01 djm Exp $ */ 1/* $OpenBSD: auth2-kbdint.c,v 1.5 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,11 +25,16 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
30#include "xmalloc.h"
28#include "packet.h" 31#include "packet.h"
32#include "key.h"
33#include "hostfile.h"
29#include "auth.h" 34#include "auth.h"
30#include "log.h" 35#include "log.h"
36#include "buffer.h"
31#include "servconf.h" 37#include "servconf.h"
32#include "xmalloc.h"
33 38
34/* import */ 39/* import */
35extern ServerOptions options; 40extern ServerOptions options;
diff --git a/auth2-none.c b/auth2-none.c
index d6738175f..1e4afa0e7 100644
--- a/auth2-none.c
+++ b/auth2-none.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-none.c,v 1.11 2006/07/09 15:15:10 stevesk Exp $ */ 1/* $OpenBSD: auth2-none.c,v 1.12 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -30,14 +30,20 @@
30 30
31#include <fcntl.h> 31#include <fcntl.h>
32 32
33#include "auth.h"
34#include "xmalloc.h" 33#include "xmalloc.h"
34#include "key.h"
35#include "hostfile.h"
36#include "auth.h"
35#include "packet.h" 37#include "packet.h"
36#include "log.h" 38#include "log.h"
39#include "buffer.h"
37#include "servconf.h" 40#include "servconf.h"
38#include "atomicio.h" 41#include "atomicio.h"
39#include "compat.h" 42#include "compat.h"
40#include "ssh2.h" 43#include "ssh2.h"
44#ifdef GSSAPI
45#include "ssh-gss.h"
46#endif
41#include "monitor_wrap.h" 47#include "monitor_wrap.h"
42 48
43/* import */ 49/* import */
diff --git a/auth2-passwd.c b/auth2-passwd.c
index a1b65da50..421c5c25d 100644
--- a/auth2-passwd.c
+++ b/auth2-passwd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-passwd.c,v 1.8 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: auth2-passwd.c,v 1.9 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,12 +25,21 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <string.h> 30#include <string.h>
31#include <stdarg.h>
29 32
30#include "xmalloc.h" 33#include "xmalloc.h"
31#include "packet.h" 34#include "packet.h"
32#include "log.h" 35#include "log.h"
36#include "key.h"
37#include "hostfile.h"
33#include "auth.h" 38#include "auth.h"
39#include "buffer.h"
40#ifdef GSSAPI
41#include "ssh-gss.h"
42#endif
34#include "monitor_wrap.h" 43#include "monitor_wrap.h"
35#include "servconf.h" 44#include "servconf.h"
36 45
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index 41763f763..9863cd9e6 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-pubkey.c,v 1.14 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: auth2-pubkey.c,v 1.15 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -30,22 +30,26 @@
30 30
31#include <pwd.h> 31#include <pwd.h>
32#include <stdio.h> 32#include <stdio.h>
33#include <stdarg.h>
33 34
35#include "xmalloc.h"
34#include "ssh.h" 36#include "ssh.h"
35#include "ssh2.h" 37#include "ssh2.h"
36#include "xmalloc.h"
37#include "packet.h" 38#include "packet.h"
38#include "buffer.h" 39#include "buffer.h"
39#include "log.h" 40#include "log.h"
40#include "servconf.h" 41#include "servconf.h"
41#include "compat.h" 42#include "compat.h"
42#include "bufaux.h"
43#include "auth.h"
44#include "key.h" 43#include "key.h"
44#include "hostfile.h"
45#include "auth.h"
45#include "pathnames.h" 46#include "pathnames.h"
46#include "uidswap.h" 47#include "uidswap.h"
47#include "auth-options.h" 48#include "auth-options.h"
48#include "canohost.h" 49#include "canohost.h"
50#ifdef GSSAPI
51#include "ssh-gss.h"
52#endif
49#include "monitor_wrap.h" 53#include "monitor_wrap.h"
50#include "misc.h" 54#include "misc.h"
51 55
diff --git a/auth2.c b/auth2.c
index 83d5224c9..2d880b57c 100644
--- a/auth2.c
+++ b/auth2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2.c,v 1.112 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: auth2.c,v 1.113 2006/08/03 03:34:41 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -28,23 +28,27 @@
28#include <sys/types.h> 28#include <sys/types.h>
29 29
30#include <pwd.h> 30#include <pwd.h>
31#include <stdarg.h>
31#include <string.h> 32#include <string.h>
32 33
33#include "ssh2.h"
34#include "xmalloc.h" 34#include "xmalloc.h"
35#include "ssh2.h"
35#include "packet.h" 36#include "packet.h"
36#include "log.h" 37#include "log.h"
38#include "buffer.h"
37#include "servconf.h" 39#include "servconf.h"
38#include "compat.h" 40#include "compat.h"
41#include "key.h"
42#include "hostfile.h"
39#include "auth.h" 43#include "auth.h"
40#include "dispatch.h" 44#include "dispatch.h"
41#include "pathnames.h" 45#include "pathnames.h"
42#include "monitor_wrap.h"
43#include "buffer.h" 46#include "buffer.h"
44 47
45#ifdef GSSAPI 48#ifdef GSSAPI
46#include "ssh-gss.h" 49#include "ssh-gss.h"
47#endif 50#endif
51#include "monitor_wrap.h"
48 52
49/* import */ 53/* import */
50extern ServerOptions options; 54extern ServerOptions options;
diff --git a/authfd.c b/authfd.c
index f8ee8051d..5c910df13 100644
--- a/authfd.c
+++ b/authfd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.c,v 1.79 2006/07/26 13:57:17 stevesk Exp $ */ 1/* $OpenBSD: authfd.c,v 1.80 2006/08/03 03:34:41 deraadt 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
@@ -43,16 +43,17 @@
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45 45
46#include <openssl/crypto.h>
46#include <fcntl.h> 47#include <fcntl.h>
47#include <stdlib.h> 48#include <stdlib.h>
49#include <signal.h>
48#include <string.h> 50#include <string.h>
49#include <unistd.h> 51#include <unistd.h>
50 52
53#include "xmalloc.h"
51#include "ssh.h" 54#include "ssh.h"
52#include "rsa.h" 55#include "rsa.h"
53#include "buffer.h" 56#include "buffer.h"
54#include "bufaux.h"
55#include "xmalloc.h"
56#include "key.h" 57#include "key.h"
57#include "authfd.h" 58#include "authfd.h"
58#include "cipher.h" 59#include "cipher.h"
diff --git a/authfd.h b/authfd.h
index 8ad8f2e71..3da256112 100644
--- a/authfd.h
+++ b/authfd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.h,v 1.35 2006/03/25 22:22:42 djm Exp $ */ 1/* $OpenBSD: authfd.h,v 1.36 2006/08/03 03:34:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,8 +16,6 @@
16#ifndef AUTHFD_H 16#ifndef AUTHFD_H
17#define AUTHFD_H 17#define AUTHFD_H
18 18
19#include "buffer.h"
20
21/* Messages for the authentication agent connection. */ 19/* Messages for the authentication agent connection. */
22#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 20#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
23#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2 21#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
diff --git a/authfile.c b/authfile.c
index 400e60b39..675085646 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfile.c,v 1.75 2006/08/01 23:36:11 stevesk Exp $ */ 1/* $OpenBSD: authfile.c,v 1.76 2006/08/03 03:34:41 deraadt 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
@@ -41,6 +41,7 @@
41#include <sys/types.h> 41#include <sys/types.h>
42#include <sys/stat.h> 42#include <sys/stat.h>
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/uio.h>
44 45
45#include <openssl/err.h> 46#include <openssl/err.h>
46#include <openssl/evp.h> 47#include <openssl/evp.h>
@@ -53,10 +54,9 @@
53#include <string.h> 54#include <string.h>
54#include <unistd.h> 55#include <unistd.h>
55 56
56#include "cipher.h"
57#include "xmalloc.h" 57#include "xmalloc.h"
58#include "cipher.h"
58#include "buffer.h" 59#include "buffer.h"
59#include "bufaux.h"
60#include "key.h" 60#include "key.h"
61#include "ssh.h" 61#include "ssh.h"
62#include "log.h" 62#include "log.h"
diff --git a/bufaux.c b/bufaux.c
index a384cc685..cbdc22c64 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bufaux.c,v 1.43 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: bufaux.c,v 1.44 2006/08/03 03:34:41 deraadt 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
@@ -39,12 +39,15 @@
39 39
40#include "includes.h" 40#include "includes.h"
41 41
42#include <sys/types.h>
43
42#include <openssl/bn.h> 44#include <openssl/bn.h>
43 45
44#include <string.h> 46#include <string.h>
47#include <stdarg.h>
45 48
46#include "bufaux.h"
47#include "xmalloc.h" 49#include "xmalloc.h"
50#include "buffer.h"
48#include "log.h" 51#include "log.h"
49#include "misc.h" 52#include "misc.h"
50 53
diff --git a/bufbn.c b/bufbn.c
index aa42ea62b..6cf65d372 100644
--- a/bufbn.c
+++ b/bufbn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bufbn.c,v 1.2 2006/07/22 20:48:22 stevesk Exp $*/ 1/* $OpenBSD: bufbn.c,v 1.3 2006/08/03 03:34:41 deraadt 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
@@ -39,12 +39,15 @@
39 39
40#include "includes.h" 40#include "includes.h"
41 41
42#include <sys/types.h>
43
42#include <openssl/bn.h> 44#include <openssl/bn.h>
43 45
44#include <string.h> 46#include <string.h>
47#include <stdarg.h>
45 48
46#include "bufaux.h"
47#include "xmalloc.h" 49#include "xmalloc.h"
50#include "buffer.h"
48#include "log.h" 51#include "log.h"
49#include "misc.h" 52#include "misc.h"
50 53
diff --git a/buffer.c b/buffer.c
index 25868b94d..e02e1e35c 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: buffer.c,v 1.30 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: buffer.c,v 1.31 2006/08/03 03:34:41 deraadt 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
@@ -18,6 +18,7 @@
18 18
19#include <stdio.h> 19#include <stdio.h>
20#include <string.h> 20#include <string.h>
21#include <stdarg.h>
21 22
22#include "xmalloc.h" 23#include "xmalloc.h"
23#include "buffer.h" 24#include "buffer.h"
diff --git a/buffer.h b/buffer.h
index 43414ae99..ecc4aea83 100644
--- a/buffer.h
+++ b/buffer.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: buffer.h,v 1.15 2006/04/16 00:48:52 djm Exp $ */ 1/* $OpenBSD: buffer.h,v 1.16 2006/08/03 03:34:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -46,4 +46,40 @@ int buffer_get_ret(Buffer *, void *, u_int);
46int buffer_consume_ret(Buffer *, u_int); 46int buffer_consume_ret(Buffer *, u_int);
47int buffer_consume_end_ret(Buffer *, u_int); 47int buffer_consume_end_ret(Buffer *, u_int);
48 48
49#include <openssl/bn.h>
50
51void buffer_put_bignum(Buffer *, const BIGNUM *);
52void buffer_put_bignum2(Buffer *, const BIGNUM *);
53void buffer_get_bignum(Buffer *, BIGNUM *);
54void buffer_get_bignum2(Buffer *, BIGNUM *);
55
56u_short buffer_get_short(Buffer *);
57void buffer_put_short(Buffer *, u_short);
58
59u_int buffer_get_int(Buffer *);
60void buffer_put_int(Buffer *, u_int);
61
62u_int64_t buffer_get_int64(Buffer *);
63void buffer_put_int64(Buffer *, u_int64_t);
64
65int buffer_get_char(Buffer *);
66void buffer_put_char(Buffer *, int);
67
68void *buffer_get_string(Buffer *, u_int *);
69void buffer_put_string(Buffer *, const void *, u_int);
70void buffer_put_cstring(Buffer *, const char *);
71
72#define buffer_skip_string(b) \
73 do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while (0)
74
75int buffer_put_bignum_ret(Buffer *, const BIGNUM *);
76int buffer_get_bignum_ret(Buffer *, BIGNUM *);
77int buffer_put_bignum2_ret(Buffer *, const BIGNUM *);
78int buffer_get_bignum2_ret(Buffer *, BIGNUM *);
79int buffer_get_short_ret(u_short *, Buffer *);
80int buffer_get_int_ret(u_int *, Buffer *);
81int buffer_get_int64_ret(u_int64_t *, Buffer *);
82void *buffer_get_string_ret(Buffer *, u_int *);
83int buffer_get_char_ret(char *, Buffer *);
84
49#endif /* BUFFER_H */ 85#endif /* BUFFER_H */
diff --git a/canohost.c b/canohost.c
index c236617d7..dd3972e8d 100644
--- a/canohost.c
+++ b/canohost.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: canohost.c,v 1.60 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: canohost.c,v 1.61 2006/08/03 03:34:41 deraadt 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
@@ -25,9 +25,10 @@
25#include <stdio.h> 25#include <stdio.h>
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28#include <stdarg.h>
28 29
29#include "packet.h"
30#include "xmalloc.h" 30#include "xmalloc.h"
31#include "packet.h"
31#include "log.h" 32#include "log.h"
32#include "canohost.h" 33#include "canohost.h"
33 34
diff --git a/channels.c b/channels.c
index fb4d287d6..dfa1e591b 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.264 2006/08/01 23:36:11 stevesk Exp $ */ 1/* $OpenBSD: channels.c,v 1.265 2006/08/03 03:34:41 deraadt 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
@@ -41,8 +41,8 @@
41 41
42#include "includes.h" 42#include "includes.h"
43 43
44#include <sys/ioctl.h>
45#include <sys/types.h> 44#include <sys/types.h>
45#include <sys/ioctl.h>
46#include <sys/un.h> 46#include <sys/un.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48#ifdef HAVE_SYS_TIME_H 48#ifdef HAVE_SYS_TIME_H
@@ -59,21 +59,22 @@
59#include <string.h> 59#include <string.h>
60#include <termios.h> 60#include <termios.h>
61#include <unistd.h> 61#include <unistd.h>
62#include <stdarg.h>
62 63
64#include "xmalloc.h"
63#include "ssh.h" 65#include "ssh.h"
64#include "ssh1.h" 66#include "ssh1.h"
65#include "ssh2.h" 67#include "ssh2.h"
66#include "packet.h" 68#include "packet.h"
67#include "xmalloc.h"
68#include "log.h" 69#include "log.h"
69#include "misc.h" 70#include "misc.h"
71#include "buffer.h"
70#include "channels.h" 72#include "channels.h"
71#include "compat.h" 73#include "compat.h"
72#include "canohost.h" 74#include "canohost.h"
73#include "key.h" 75#include "key.h"
74#include "authfd.h" 76#include "authfd.h"
75#include "pathnames.h" 77#include "pathnames.h"
76#include "bufaux.h"
77 78
78/* -- channel core */ 79/* -- channel core */
79 80
diff --git a/channels.h b/channels.h
index ed719f724..2674f096e 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.87 2006/07/21 12:43:36 dtucker Exp $ */ 1/* $OpenBSD: channels.h,v 1.88 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -38,8 +38,6 @@
38#ifndef CHANNEL_H 38#ifndef CHANNEL_H
39#define CHANNEL_H 39#define CHANNEL_H
40 40
41#include "buffer.h"
42
43/* Definitions for channel types. */ 41/* Definitions for channel types. */
44#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ 42#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */
45#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ 43#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */
diff --git a/cipher-3des1.c b/cipher-3des1.c
index 2e8735d54..61798bfde 100644
--- a/cipher-3des1.c
+++ b/cipher-3des1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher-3des1.c,v 1.5 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: cipher-3des1.c,v 1.6 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Markus Friedl. All rights reserved. 3 * Copyright (c) 2003 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,6 +25,8 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <openssl/evp.h> 30#include <openssl/evp.h>
29 31
30#include <string.h> 32#include <string.h>
diff --git a/cipher-bf1.c b/cipher-bf1.c
index 95b4e5e93..eb4c04777 100644
--- a/cipher-bf1.c
+++ b/cipher-bf1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher-bf1.c,v 1.4 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: cipher-bf1.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Markus Friedl. All rights reserved. 3 * Copyright (c) 2003 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,6 +25,8 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <openssl/evp.h> 30#include <openssl/evp.h>
29 31
30#include <string.h> 32#include <string.h>
diff --git a/cipher-ctr.c b/cipher-ctr.c
index 105d0bd5b..9733b7d56 100644
--- a/cipher-ctr.c
+++ b/cipher-ctr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher-ctr.c,v 1.9 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: cipher-ctr.c,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
4 * 4 *
@@ -16,12 +16,14 @@
16 */ 16 */
17#include "includes.h" 17#include "includes.h"
18 18
19#include <sys/types.h>
20
19#include <string.h> 21#include <string.h>
20 22
21#include <openssl/evp.h> 23#include <openssl/evp.h>
22 24
23#include "log.h"
24#include "xmalloc.h" 25#include "xmalloc.h"
26#include "log.h"
25 27
26/* compatibility with old or broken OpenSSL versions */ 28/* compatibility with old or broken OpenSSL versions */
27#include "openbsd-compat/openssl-compat.h" 29#include "openbsd-compat/openssl-compat.h"
diff --git a/cipher.c b/cipher.c
index 20fa59c6a..b264063c4 100644
--- a/cipher.c
+++ b/cipher.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher.c,v 1.80 2006/07/22 20:48:22 stevesk Exp $ */ 1/* $OpenBSD: cipher.c,v 1.81 2006/08/03 03:34:42 deraadt 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
@@ -37,9 +37,12 @@
37 37
38#include "includes.h" 38#include "includes.h"
39 39
40#include <sys/types.h>
41
40#include <openssl/md5.h> 42#include <openssl/md5.h>
41 43
42#include <string.h> 44#include <string.h>
45#include <stdarg.h>
43 46
44#include "xmalloc.h" 47#include "xmalloc.h"
45#include "log.h" 48#include "log.h"
diff --git a/cleanup.c b/cleanup.c
index 0d9f2a6d2..c41ef1c6a 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cleanup.c,v 1.4 2006/07/17 01:31:09 stevesk Exp $ */ 1/* $OpenBSD: cleanup.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
4 * 4 *
@@ -17,7 +17,10 @@
17 17
18#include "config.h" 18#include "config.h"
19 19
20#include <sys/types.h>
21
20#include <unistd.h> 22#include <unistd.h>
23#include <stdarg.h>
21 24
22#include "log.h" 25#include "log.h"
23 26
diff --git a/clientloop.c b/clientloop.c
index f9ffa2bb7..132d75a44 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.174 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.175 2006/08/03 03:34:42 deraadt 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
@@ -82,20 +82,20 @@
82#include <stdlib.h> 82#include <stdlib.h>
83#include <string.h> 83#include <string.h>
84#include <termios.h> 84#include <termios.h>
85#include <pwd.h>
85#include <unistd.h> 86#include <unistd.h>
86 87
88#include "xmalloc.h"
87#include "ssh.h" 89#include "ssh.h"
88#include "ssh1.h" 90#include "ssh1.h"
89#include "ssh2.h" 91#include "ssh2.h"
90#include "xmalloc.h"
91#include "packet.h" 92#include "packet.h"
92#include "buffer.h" 93#include "buffer.h"
93#include "compat.h" 94#include "compat.h"
94#include "channels.h" 95#include "channels.h"
95#include "dispatch.h" 96#include "dispatch.h"
96#include "buffer.h"
97#include "bufaux.h"
98#include "key.h" 97#include "key.h"
98#include "cipher.h"
99#include "kex.h" 99#include "kex.h"
100#include "log.h" 100#include "log.h"
101#include "readconf.h" 101#include "readconf.h"
diff --git a/compat.c b/compat.c
index e1a8b2bfd..da67f9410 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: compat.c,v 1.75 2006/07/26 13:57:17 stevesk Exp $ */ 1/* $OpenBSD: compat.c,v 1.76 2006/08/03 03:34:42 deraadt 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 *
@@ -25,12 +25,15 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <stdlib.h> 30#include <stdlib.h>
29#include <string.h> 31#include <string.h>
32#include <stdarg.h>
30 33
34#include "xmalloc.h"
31#include "buffer.h" 35#include "buffer.h"
32#include "packet.h" 36#include "packet.h"
33#include "xmalloc.h"
34#include "compat.h" 37#include "compat.h"
35#include "log.h" 38#include "log.h"
36#include "match.h" 39#include "match.h"
diff --git a/compress.c b/compress.c
index 8aba84efa..f5d30b8a6 100644
--- a/compress.c
+++ b/compress.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: compress.c,v 1.23 2006/03/25 13:17:01 djm Exp $ */ 1/* $OpenBSD: compress.c,v 1.24 2006/08/03 03:34:42 deraadt 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
@@ -14,6 +14,10 @@
14 14
15#include "includes.h" 15#include "includes.h"
16 16
17#include <sys/types.h>
18
19#include <stdarg.h>
20
17#include "log.h" 21#include "log.h"
18#include "buffer.h" 22#include "buffer.h"
19#include "zlib.h" 23#include "zlib.h"
diff --git a/deattack.c b/deattack.c
index 57a747da5..b4fed7f85 100644
--- a/deattack.c
+++ b/deattack.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: deattack.c,v 1.28 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: deattack.c,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Cryptographic attack detector for ssh - source code 3 * Cryptographic attack detector for ssh - source code
4 * 4 *
@@ -20,12 +20,16 @@
20 20
21#include "includes.h" 21#include "includes.h"
22 22
23#include <sys/types.h>
24
23#include <string.h> 25#include <string.h>
26#include <stdio.h>
27#include <stdarg.h>
24 28
29#include "xmalloc.h"
25#include "deattack.h" 30#include "deattack.h"
26#include "log.h" 31#include "log.h"
27#include "crc32.h" 32#include "crc32.h"
28#include "xmalloc.h"
29#include "misc.h" 33#include "misc.h"
30 34
31/* SSH Constants */ 35/* SSH Constants */
diff --git a/dh.c b/dh.c
index 4ca949138..925eedddf 100644
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.c,v 1.41 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: dh.c,v 1.42 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * 4 *
diff --git a/dispatch.c b/dispatch.c
index c1d98a78e..d6b63be4b 100644
--- a/dispatch.c
+++ b/dispatch.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dispatch.c,v 1.20 2006/07/23 01:11:05 stevesk Exp $ */ 1/* $OpenBSD: dispatch.c,v 1.21 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -22,9 +22,13 @@
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25
25#include "includes.h" 26#include "includes.h"
26 27
28#include <sys/types.h>
29
27#include <signal.h> 30#include <signal.h>
31#include <stdarg.h>
28 32
29#include "ssh1.h" 33#include "ssh1.h"
30#include "ssh2.h" 34#include "ssh2.h"
diff --git a/dns.c b/dns.c
index 008fc596f..229210835 100644
--- a/dns.c
+++ b/dns.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dns.c,v 1.22 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: dns.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wesley Griffin. All rights reserved. 4 * Copyright (c) 2003 Wesley Griffin. All rights reserved.
diff --git a/dns.h b/dns.h
index 8f9601824..b2633a1fe 100644
--- a/dns.h
+++ b/dns.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dns.h,v 1.9 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: dns.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wesley Griffin. All rights reserved. 4 * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -25,13 +25,6 @@
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include "includes.h"
29
30#include <sys/types.h>
31#include <sys/socket.h>
32
33#include <stdio.h>
34
35#ifndef DNS_H 28#ifndef DNS_H
36#define DNS_H 29#define DNS_H
37 30
diff --git a/fatal.c b/fatal.c
index 1f2cd0bc8..5e5aa3fe1 100644
--- a/fatal.c
+++ b/fatal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: fatal.c,v 1.6 2006/07/10 16:37:36 stevesk Exp $ */ 1/* $OpenBSD: fatal.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,6 +25,8 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <stdarg.h> 30#include <stdarg.h>
29 31
30#include "log.h" 32#include "log.h"
diff --git a/groupaccess.c b/groupaccess.c
index 3431691b9..e73f62b22 100644
--- a/groupaccess.c
+++ b/groupaccess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: groupaccess.c,v 1.11 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: groupaccess.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Kevin Steves. All rights reserved. 3 * Copyright (c) 2001 Kevin Steves. All rights reserved.
4 * 4 *
@@ -30,9 +30,10 @@
30 30
31#include <grp.h> 31#include <grp.h>
32#include <unistd.h> 32#include <unistd.h>
33#include <stdarg.h>
33 34
34#include "groupaccess.h"
35#include "xmalloc.h" 35#include "xmalloc.h"
36#include "groupaccess.h"
36#include "match.h" 37#include "match.h"
37#include "log.h" 38#include "log.h"
38 39
diff --git a/groupaccess.h b/groupaccess.h
index b0baccfbf..04b449894 100644
--- a/groupaccess.h
+++ b/groupaccess.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: groupaccess.h,v 1.6 2006/07/02 22:45:59 stevesk Exp $ */ 1/* $OpenBSD: groupaccess.h,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Kevin Steves. All rights reserved. 4 * Copyright (c) 2001 Kevin Steves. All rights reserved.
@@ -27,8 +27,6 @@
27#ifndef GROUPACCESS_H 27#ifndef GROUPACCESS_H
28#define GROUPACCESS_H 28#define GROUPACCESS_H
29 29
30#include <sys/types.h>
31
32int ga_init(const char *, gid_t); 30int ga_init(const char *, gid_t);
33int ga_match(char * const *, int); 31int ga_match(char * const *, int);
34void ga_free(void); 32void ga_free(void);
diff --git a/gss-genr.c b/gss-genr.c
index 93dbeeebb..da39479e1 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-genr.c,v 1.12 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: gss-genr.c,v 1.13 2006/08/03 03:34:42 deraadt 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.
@@ -28,13 +28,15 @@
28 28
29#ifdef GSSAPI 29#ifdef GSSAPI
30 30
31#include <sys/types.h>
31#include <sys/param.h> 32#include <sys/param.h>
32 33
34#include <stdarg.h>
33#include <string.h> 35#include <string.h>
34#include <unistd.h> 36#include <unistd.h>
35 37
36#include "xmalloc.h" 38#include "xmalloc.h"
37#include "bufaux.h" 39#include "buffer.h"
38#include "log.h" 40#include "log.h"
39#include "ssh2.h" 41#include "ssh2.h"
40 42
diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c
index 7b78cfe0a..006bedad9 100644
--- a/gss-serv-krb5.c
+++ b/gss-serv-krb5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv-krb5.c,v 1.6 2006/07/02 18:36:47 stevesk Exp $ */ 1/* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt 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.
@@ -29,13 +29,18 @@
29#ifdef GSSAPI 29#ifdef GSSAPI
30#ifdef KRB5 30#ifdef KRB5
31 31
32#include <sys/types.h>
33
32#include <string.h> 34#include <string.h>
33 35
34#include "auth.h"
35#include "xmalloc.h" 36#include "xmalloc.h"
37#include "key.h"
38#include "hostfile.h"
39#include "auth.h"
36#include "log.h" 40#include "log.h"
37#include "servconf.h" 41#include "servconf.h"
38 42
43#include "buffer.h"
39#include "ssh-gss.h" 44#include "ssh-gss.h"
40 45
41extern ServerOptions options; 46extern ServerOptions options;
diff --git a/gss-serv.c b/gss-serv.c
index b5c5538fe..296f63a89 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv.c,v 1.19 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.20 2006/08/03 03:34:42 deraadt 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.
@@ -28,15 +28,19 @@
28 28
29#ifdef GSSAPI 29#ifdef GSSAPI
30 30
31#include <sys/types.h>
32
31#include <string.h> 33#include <string.h>
32#include <unistd.h> 34#include <unistd.h>
33 35
34#include "bufaux.h" 36#include "xmalloc.h"
37#include "buffer.h"
38#include "key.h"
39#include "hostfile.h"
35#include "auth.h" 40#include "auth.h"
36#include "log.h" 41#include "log.h"
37#include "channels.h" 42#include "channels.h"
38#include "session.h" 43#include "session.h"
39#include "xmalloc.h"
40#include "misc.h" 44#include "misc.h"
41 45
42#include "ssh-gss.h" 46#include "ssh-gss.h"
diff --git a/hostfile.c b/hostfile.c
index 7ac69e776..08ba44264 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.c,v 1.44 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: hostfile.c,v 1.45 2006/08/03 03:34:42 deraadt 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
@@ -50,11 +50,11 @@
50#include <stdlib.h> 50#include <stdlib.h>
51#include <string.h> 51#include <string.h>
52 52
53#include "xmalloc.h"
53#include "match.h" 54#include "match.h"
54#include "key.h" 55#include "key.h"
55#include "hostfile.h" 56#include "hostfile.h"
56#include "log.h" 57#include "log.h"
57#include "xmalloc.h"
58 58
59static int 59static int
60extract_salt(const char *s, u_int l, char *salt, size_t salt_len) 60extract_salt(const char *s, u_int l, char *salt, size_t salt_len)
diff --git a/includes.h b/includes.h
index 9b6a63fb3..8e600567d 100644
--- a/includes.h
+++ b/includes.h
@@ -25,9 +25,6 @@
25#ifdef HAVE_LIMITS_H 25#ifdef HAVE_LIMITS_H
26# include <limits.h> /* For PATH_MAX */ 26# include <limits.h> /* For PATH_MAX */
27#endif 27#endif
28#ifdef HAVE_GETOPT_H
29# include <getopt.h>
30#endif
31#ifdef HAVE_BSTRING_H 28#ifdef HAVE_BSTRING_H
32# include <bstring.h> 29# include <bstring.h>
33#endif 30#endif
diff --git a/kex.c b/kex.c
index 3525307c3..0c36519a1 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.c,v 1.75 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: kex.c,v 1.76 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -27,21 +27,21 @@
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29 29
30#include <openssl/crypto.h> 30#include <signal.h>
31
32#include <stdio.h> 31#include <stdio.h>
33#include <stdlib.h> 32#include <stdlib.h>
34#include <string.h> 33#include <string.h>
35 34
36#include "ssh2.h" 35#include <openssl/crypto.h>
36
37#include "xmalloc.h" 37#include "xmalloc.h"
38#include "ssh2.h"
38#include "buffer.h" 39#include "buffer.h"
39#include "bufaux.h"
40#include "packet.h" 40#include "packet.h"
41#include "compat.h" 41#include "compat.h"
42#include "cipher.h" 42#include "cipher.h"
43#include "kex.h"
44#include "key.h" 43#include "key.h"
44#include "kex.h"
45#include "log.h" 45#include "log.h"
46#include "mac.h" 46#include "mac.h"
47#include "match.h" 47#include "match.h"
diff --git a/kex.h b/kex.h
index a48c5c885..b1b20f500 100644
--- a/kex.h
+++ b/kex.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.h,v 1.43 2006/07/23 01:11:05 stevesk Exp $ */ 1/* $OpenBSD: kex.h,v 1.44 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -29,12 +29,6 @@
29#include <signal.h> 29#include <signal.h>
30#include <openssl/evp.h> 30#include <openssl/evp.h>
31 31
32#include <signal.h>
33
34#include "buffer.h"
35#include "cipher.h"
36#include "key.h"
37
38#define KEX_DH1 "diffie-hellman-group1-sha1" 32#define KEX_DH1 "diffie-hellman-group1-sha1"
39#define KEX_DH14 "diffie-hellman-group14-sha1" 33#define KEX_DH14 "diffie-hellman-group14-sha1"
40#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1" 34#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
diff --git a/kexdh.c b/kexdh.c
index 2d13127b8..56e22f5bc 100644
--- a/kexdh.c
+++ b/kexdh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexdh.c,v 1.22 2006/03/25 13:17:02 djm Exp $ */ 1/* $OpenBSD: kexdh.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,11 +25,16 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
30#include <signal.h>
31
28#include <openssl/evp.h> 32#include <openssl/evp.h>
29 33
30#include "buffer.h" 34#include "buffer.h"
31#include "bufaux.h"
32#include "ssh2.h" 35#include "ssh2.h"
36#include "key.h"
37#include "cipher.h"
33#include "kex.h" 38#include "kex.h"
34 39
35void 40void
diff --git a/kexdhc.c b/kexdhc.c
index 9d123e748..bf875ae07 100644
--- a/kexdhc.c
+++ b/kexdhc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexdhc.c,v 1.8 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: kexdhc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,11 +25,16 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <stdio.h> 30#include <stdio.h>
29#include <string.h> 31#include <string.h>
32#include <signal.h>
30 33
31#include "xmalloc.h" 34#include "xmalloc.h"
35#include "buffer.h"
32#include "key.h" 36#include "key.h"
37#include "cipher.h"
33#include "kex.h" 38#include "kex.h"
34#include "log.h" 39#include "log.h"
35#include "packet.h" 40#include "packet.h"
diff --git a/kexdhs.c b/kexdhs.c
index c64cd77cb..7d2c21eed 100644
--- a/kexdhs.c
+++ b/kexdhs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexdhs.c,v 1.6 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: kexdhs.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,15 +25,22 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
28#include <string.h> 29#include <string.h>
30#include <signal.h>
29 31
30#include "xmalloc.h" 32#include "xmalloc.h"
33#include "buffer.h"
31#include "key.h" 34#include "key.h"
35#include "cipher.h"
32#include "kex.h" 36#include "kex.h"
33#include "log.h" 37#include "log.h"
34#include "packet.h" 38#include "packet.h"
35#include "dh.h" 39#include "dh.h"
36#include "ssh2.h" 40#include "ssh2.h"
41#ifdef GSSAPI
42#include "ssh-gss.h"
43#endif
37#include "monitor_wrap.h" 44#include "monitor_wrap.h"
38 45
39void 46void
diff --git a/kexgex.c b/kexgex.c
index 5ab6745a3..b60ab5c53 100644
--- a/kexgex.c
+++ b/kexgex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgex.c,v 1.26 2006/03/25 13:17:02 djm Exp $ */ 1/* $OpenBSD: kexgex.c,v 1.27 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -26,10 +26,14 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#include <sys/types.h>
30
29#include <openssl/evp.h> 31#include <openssl/evp.h>
32#include <signal.h>
30 33
31#include "buffer.h" 34#include "buffer.h"
32#include "bufaux.h" 35#include "key.h"
36#include "cipher.h"
33#include "kex.h" 37#include "kex.h"
34#include "ssh2.h" 38#include "ssh2.h"
35 39
diff --git a/kexgexc.c b/kexgexc.c
index 9c618ec6c..fc48880d4 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexc.c,v 1.8 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: kexgexc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -26,11 +26,16 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#include <sys/types.h>
30
29#include <stdio.h> 31#include <stdio.h>
30#include <string.h> 32#include <string.h>
33#include <signal.h>
31 34
32#include "xmalloc.h" 35#include "xmalloc.h"
36#include "buffer.h"
33#include "key.h" 37#include "key.h"
38#include "cipher.h"
34#include "kex.h" 39#include "kex.h"
35#include "log.h" 40#include "log.h"
36#include "packet.h" 41#include "packet.h"
diff --git a/kexgexs.c b/kexgexs.c
index 0b01ed800..7599f2af4 100644
--- a/kexgexs.c
+++ b/kexgexs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexs.c,v 1.7 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: kexgexs.c,v 1.8 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -30,15 +30,21 @@
30 30
31#include <stdio.h> 31#include <stdio.h>
32#include <string.h> 32#include <string.h>
33#include <signal.h>
33 34
34#include "xmalloc.h" 35#include "xmalloc.h"
36#include "buffer.h"
35#include "key.h" 37#include "key.h"
38#include "cipher.h"
36#include "kex.h" 39#include "kex.h"
37#include "log.h" 40#include "log.h"
38#include "packet.h" 41#include "packet.h"
39#include "dh.h" 42#include "dh.h"
40#include "ssh2.h" 43#include "ssh2.h"
41#include "compat.h" 44#include "compat.h"
45#ifdef GSSAPI
46#include "ssh-gss.h"
47#endif
42#include "monitor_wrap.h" 48#include "monitor_wrap.h"
43 49
44void 50void
diff --git a/key.c b/key.c
index 745c474f9..40aab20ea 100644
--- a/key.c
+++ b/key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: key.c,v 1.66 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: key.c,v 1.67 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * read_bignum(): 3 * read_bignum():
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -32,8 +32,11 @@
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35
35#include "includes.h" 36#include "includes.h"
36 37
38#include <sys/types.h>
39
37#include <openssl/evp.h> 40#include <openssl/evp.h>
38 41
39#include <stdio.h> 42#include <stdio.h>
@@ -44,7 +47,6 @@
44#include "rsa.h" 47#include "rsa.h"
45#include "uuencode.h" 48#include "uuencode.h"
46#include "buffer.h" 49#include "buffer.h"
47#include "bufaux.h"
48#include "log.h" 50#include "log.h"
49 51
50Key * 52Key *
diff --git a/key.h b/key.h
index 57af279b8..6873dd793 100644
--- a/key.h
+++ b/key.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: key.h,v 1.25 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: key.h,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -29,8 +29,6 @@
29#include <openssl/rsa.h> 29#include <openssl/rsa.h>
30#include <openssl/dsa.h> 30#include <openssl/dsa.h>
31 31
32#include <stdio.h>
33
34typedef struct Key Key; 32typedef struct Key Key;
35enum types { 33enum types {
36 KEY_RSA1, 34 KEY_RSA1,
diff --git a/log.c b/log.c
index 871bc2c42..6eac73743 100644
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.c,v 1.37 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: log.c,v 1.38 2006/08/03 03:34:42 deraadt 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
@@ -36,6 +36,8 @@
36 36
37#include "includes.h" 37#include "includes.h"
38 38
39#include <sys/types.h>
40
39#include <stdarg.h> 41#include <stdarg.h>
40#include <stdio.h> 42#include <stdio.h>
41#include <stdlib.h> 43#include <stdlib.h>
@@ -46,8 +48,8 @@
46# include <vis.h> 48# include <vis.h>
47#endif 49#endif
48 50
49#include "log.h"
50#include "xmalloc.h" 51#include "xmalloc.h"
52#include "log.h"
51 53
52static LogLevel log_level = SYSLOG_LEVEL_INFO; 54static LogLevel log_level = SYSLOG_LEVEL_INFO;
53static int log_on_stderr = 1; 55static int log_on_stderr = 1;
diff --git a/log.h b/log.h
index 15ebc93b5..a8e788a2d 100644
--- a/log.h
+++ b/log.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.h,v 1.13 2006/07/10 16:37:36 stevesk Exp $ */ 1/* $OpenBSD: log.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -15,12 +15,6 @@
15#ifndef SSH_LOG_H 15#ifndef SSH_LOG_H
16#define SSH_LOG_H 16#define SSH_LOG_H
17 17
18#include "includes.h"
19
20#include <stdarg.h>
21
22#include <syslog.h> /* Needed for LOG_AUTHPRIV (if present) */
23
24/* Supported syslog facilities and levels. */ 18/* Supported syslog facilities and levels. */
25typedef enum { 19typedef enum {
26 SYSLOG_FACILITY_DAEMON, 20 SYSLOG_FACILITY_DAEMON,
diff --git a/loginrec.c b/loginrec.c
index 955d42e8f..7850312b6 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -159,8 +159,10 @@
159#include <string.h> 159#include <string.h>
160#include <unistd.h> 160#include <unistd.h>
161 161
162#include "ssh.h"
163#include "xmalloc.h" 162#include "xmalloc.h"
163#include "key.h"
164#include "hostfile.h"
165#include "ssh.h"
164#include "loginrec.h" 166#include "loginrec.h"
165#include "log.h" 167#include "log.h"
166#include "atomicio.h" 168#include "atomicio.h"
diff --git a/loginrec.h b/loginrec.h
index 4fe24ac2a..859e1a630 100644
--- a/loginrec.h
+++ b/loginrec.h
@@ -31,10 +31,6 @@
31 31
32#include "includes.h" 32#include "includes.h"
33 33
34#include <sys/types.h>
35#include <netinet/in.h>
36#include <sys/socket.h>
37
38/** 34/**
39 ** you should use the login_* calls to work around platform dependencies 35 ** you should use the login_* calls to work around platform dependencies
40 **/ 36 **/
diff --git a/mac.c b/mac.c
index a59e7edf1..edf9b69bd 100644
--- a/mac.c
+++ b/mac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mac.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: mac.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,13 +25,18 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <openssl/hmac.h> 30#include <openssl/hmac.h>
29 31
30#include <string.h> 32#include <string.h>
33#include <signal.h>
31 34
32#include "xmalloc.h" 35#include "xmalloc.h"
33#include "log.h" 36#include "log.h"
34#include "cipher.h" 37#include "cipher.h"
38#include "buffer.h"
39#include "key.h"
35#include "kex.h" 40#include "kex.h"
36#include "mac.h" 41#include "mac.h"
37#include "misc.h" 42#include "misc.h"
diff --git a/match.c b/match.c
index 8f12ef539..e3c993073 100644
--- a/match.c
+++ b/match.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: match.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: match.c,v 1.26 2006/08/03 03:34:42 deraadt 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
@@ -37,11 +37,13 @@
37 37
38#include "includes.h" 38#include "includes.h"
39 39
40#include <sys/types.h>
41
40#include <ctype.h> 42#include <ctype.h>
41#include <string.h> 43#include <string.h>
42 44
43#include "match.h"
44#include "xmalloc.h" 45#include "xmalloc.h"
46#include "match.h"
45 47
46/* 48/*
47 * Returns true if the given string matches the pattern (which may contain ? 49 * Returns true if the given string matches the pattern (which may contain ?
diff --git a/md-sha256.c b/md-sha256.c
index 063a1014f..8c1b3b92d 100644
--- a/md-sha256.c
+++ b/md-sha256.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md-sha256.c,v 1.4 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: md-sha256.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2005 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2005 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -18,6 +18,8 @@
18/* EVP wrapper for SHA256 */ 18/* EVP wrapper for SHA256 */
19 19
20#include "includes.h" 20#include "includes.h"
21
22#include <sys/types.h>
21#include <openssl/opensslv.h> 23#include <openssl/opensslv.h>
22 24
23#if !defined(HAVE_EVP_SHA256) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) 25#if !defined(HAVE_EVP_SHA256) && (OPENSSL_VERSION_NUMBER >= 0x00907000L)
diff --git a/misc.c b/misc.c
index ef2014f61..78bca2fae 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.63 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: misc.c,v 1.64 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -26,8 +26,8 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#include <sys/ioctl.h>
30#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/ioctl.h>
31#include <sys/socket.h> 31#include <sys/socket.h>
32#include <sys/param.h> 32#include <sys/param.h>
33 33
@@ -50,9 +50,9 @@
50#include <net/if.h> 50#include <net/if.h>
51#endif 51#endif
52 52
53#include "xmalloc.h"
53#include "misc.h" 54#include "misc.h"
54#include "log.h" 55#include "log.h"
55#include "xmalloc.h"
56#include "ssh.h" 56#include "ssh.h"
57 57
58/* remove newline at end of string */ 58/* remove newline at end of string */
diff --git a/misc.h b/misc.h
index 1dded7215..072470bad 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.h,v 1.34 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: misc.h,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -15,11 +15,6 @@
15#ifndef _MISC_H 15#ifndef _MISC_H
16#define _MISC_H 16#define _MISC_H
17 17
18#include <sys/types.h>
19
20#include <pwd.h>
21#include <stdio.h>
22
23/* misc.c */ 18/* misc.c */
24 19
25char *chop(char *); 20char *chop(char *);
diff --git a/moduli.c b/moduli.c
index a164b4f5d..e18929bad 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.17 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: moduli.c,v 1.18 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 3 * Copyright 1994 Phil Karn <karn@qualcomm.com>
4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -46,6 +46,7 @@
46#include <stdio.h> 46#include <stdio.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <string.h> 48#include <string.h>
49#include <stdarg.h>
49#include <time.h> 50#include <time.h>
50 51
51#include "xmalloc.h" 52#include "xmalloc.h"
diff --git a/monitor.c b/monitor.c
index 325179854..595aae1a8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.84 2006/07/26 13:57:17 stevesk Exp $ */ 1/* $OpenBSD: monitor.c,v 1.85 2006/08/03 03:34:42 deraadt 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>
@@ -30,6 +30,7 @@
30#include <sys/types.h> 30#include <sys/types.h>
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/socket.h> 32#include <sys/socket.h>
33#include "openbsd-compat/sys-tree.h"
33#include <sys/wait.h> 34#include <sys/wait.h>
34 35
35#include <errno.h> 36#include <errno.h>
@@ -48,8 +49,13 @@
48 49
49#include <openssl/dh.h> 50#include <openssl/dh.h>
50 51
52#include "xmalloc.h"
51#include "ssh.h" 53#include "ssh.h"
54#include "key.h"
55#include "buffer.h"
56#include "hostfile.h"
52#include "auth.h" 57#include "auth.h"
58#include "cipher.h"
53#include "kex.h" 59#include "kex.h"
54#include "dh.h" 60#include "dh.h"
55#ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */ 61#ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */
@@ -70,17 +76,16 @@
70#include "servconf.h" 76#include "servconf.h"
71#include "monitor.h" 77#include "monitor.h"
72#include "monitor_mm.h" 78#include "monitor_mm.h"
79#ifdef GSSAPI
80#include "ssh-gss.h"
81#endif
73#include "monitor_wrap.h" 82#include "monitor_wrap.h"
74#include "monitor_fdpass.h" 83#include "monitor_fdpass.h"
75#include "xmalloc.h"
76#include "misc.h" 84#include "misc.h"
77#include "buffer.h"
78#include "bufaux.h"
79#include "compat.h" 85#include "compat.h"
80#include "ssh2.h" 86#include "ssh2.h"
81 87
82#ifdef GSSAPI 88#ifdef GSSAPI
83#include "ssh-gss.h"
84static Gssctxt *gsscontext = NULL; 89static Gssctxt *gsscontext = NULL;
85#endif 90#endif
86 91
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index d3e65cbaa..c5fc4c397 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_fdpass.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: monitor_fdpass.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright 2001 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2001 Niels Provos <provos@citi.umich.edu>
4 * All rights reserved. 4 * All rights reserved.
@@ -32,6 +32,7 @@
32 32
33#include <errno.h> 33#include <errno.h>
34#include <string.h> 34#include <string.h>
35#include <stdarg.h>
35 36
36#include "log.h" 37#include "log.h"
37#include "monitor_fdpass.h" 38#include "monitor_fdpass.h"
diff --git a/monitor_mm.c b/monitor_mm.c
index 89a8c9b49..dab747532 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_mm.c,v 1.14 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: monitor_mm.c,v 1.15 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * All rights reserved. 4 * All rights reserved.
@@ -26,16 +26,19 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#include <sys/types.h>
29#ifdef HAVE_SYS_MMAN_H 30#ifdef HAVE_SYS_MMAN_H
30#include <sys/mman.h> 31#include <sys/mman.h>
31#endif 32#endif
32#include <sys/param.h> 33#include <sys/param.h>
34#include "openbsd-compat/sys-tree.h"
33 35
34#include <errno.h> 36#include <errno.h>
37#include <stdarg.h>
35#include <string.h> 38#include <string.h>
36 39
37#include "ssh.h"
38#include "xmalloc.h" 40#include "xmalloc.h"
41#include "ssh.h"
39#include "log.h" 42#include "log.h"
40#include "monitor_mm.h" 43#include "monitor_mm.h"
41 44
diff --git a/monitor_mm.h b/monitor_mm.h
index 3499c7521..36a07a06d 100644
--- a/monitor_mm.h
+++ b/monitor_mm.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_mm.h,v 1.3 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: monitor_mm.h,v 1.4 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 4 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -27,7 +27,6 @@
27 27
28#ifndef _MM_H_ 28#ifndef _MM_H_
29#define _MM_H_ 29#define _MM_H_
30#include "openbsd-compat/sys-tree.h"
31 30
32struct mm_share { 31struct mm_share {
33 RB_ENTRY(mm_share) next; 32 RB_ENTRY(mm_share) next;
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 27e2fc7c3..52ea17592 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.49 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.50 2006/08/03 03:34:42 deraadt 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>
@@ -29,21 +29,25 @@
29 29
30#include <sys/types.h> 30#include <sys/types.h>
31 31
32#include <openssl/bn.h>
33#include <openssl/dh.h>
34
35#include <errno.h> 32#include <errno.h>
36#include <pwd.h> 33#include <pwd.h>
34#include <signal.h>
37#include <stdio.h> 35#include <stdio.h>
38#include <string.h> 36#include <string.h>
39 37
38#include <openssl/bn.h>
39#include <openssl/dh.h>
40
41#include "xmalloc.h"
40#include "ssh.h" 42#include "ssh.h"
41#include "dh.h" 43#include "dh.h"
44#include "buffer.h"
45#include "key.h"
46#include "cipher.h"
42#include "kex.h" 47#include "kex.h"
48#include "hostfile.h"
43#include "auth.h" 49#include "auth.h"
44#include "auth-options.h" 50#include "auth-options.h"
45#include "buffer.h"
46#include "bufaux.h"
47#include "packet.h" 51#include "packet.h"
48#include "mac.h" 52#include "mac.h"
49#include "log.h" 53#include "log.h"
@@ -55,21 +59,18 @@
55#include "zlib.h" 59#include "zlib.h"
56#endif 60#endif
57#include "monitor.h" 61#include "monitor.h"
62#ifdef GSSAPI
63#include "ssh-gss.h"
64#endif
58#include "monitor_wrap.h" 65#include "monitor_wrap.h"
59#include "xmalloc.h"
60#include "atomicio.h" 66#include "atomicio.h"
61#include "monitor_fdpass.h" 67#include "monitor_fdpass.h"
62#include "misc.h" 68#include "misc.h"
63#include "servconf.h" 69#include "servconf.h"
64 70
65#include "auth.h"
66#include "channels.h" 71#include "channels.h"
67#include "session.h" 72#include "session.h"
68 73
69#ifdef GSSAPI
70#include "ssh-gss.h"
71#endif
72
73/* Imports */ 74/* Imports */
74extern int compat20; 75extern int compat20;
75extern Newkeys *newkeys[]; 76extern Newkeys *newkeys[];
diff --git a/monitor_wrap.h b/monitor_wrap.h
index fd5cccd08..329189c2a 100644
--- a/monitor_wrap.h
+++ b/monitor_wrap.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.h,v 1.19 2006/07/14 01:15:28 stevesk Exp $ */ 1/* $OpenBSD: monitor_wrap.h,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 4 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -28,13 +28,6 @@
28#ifndef _MM_WRAP_H_ 28#ifndef _MM_WRAP_H_
29#define _MM_WRAP_H_ 29#define _MM_WRAP_H_
30 30
31#include <sys/types.h>
32
33#include <pwd.h>
34
35#include "key.h"
36#include "buffer.h"
37
38extern int use_privsep; 31extern int use_privsep;
39#define PRIVSEP(x) (use_privsep ? mm_##x : x) 32#define PRIVSEP(x) (use_privsep ? mm_##x : x)
40 33
@@ -61,7 +54,6 @@ int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *);
61BIGNUM *mm_auth_rsa_generate_challenge(Key *); 54BIGNUM *mm_auth_rsa_generate_challenge(Key *);
62 55
63#ifdef GSSAPI 56#ifdef GSSAPI
64#include "ssh-gss.h"
65OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID); 57OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID);
66OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *, 58OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *,
67 gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *); 59 gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *);
diff --git a/msg.c b/msg.c
index 322472668..cd5f98c4f 100644
--- a/msg.c
+++ b/msg.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: msg.c,v 1.14 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: msg.c,v 1.15 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -22,13 +22,17 @@
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25
25#include "includes.h" 26#include "includes.h"
26 27
27#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/uio.h>
28 30
29#include <errno.h> 31#include <errno.h>
32#include <stdio.h>
30#include <string.h> 33#include <string.h>
31#include <unistd.h> 34#include <unistd.h>
35#include <stdarg.h>
32 36
33#include "buffer.h" 37#include "buffer.h"
34#include "log.h" 38#include "log.h"
diff --git a/nchan.c b/nchan.c
index 78908c3c6..ad461f4af 100644
--- a/nchan.c
+++ b/nchan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: nchan.c,v 1.56 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: nchan.c,v 1.57 2006/08/03 03:34:42 deraadt 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 *
@@ -30,6 +30,7 @@
30 30
31#include <errno.h> 31#include <errno.h>
32#include <string.h> 32#include <string.h>
33#include <stdarg.h>
33 34
34#include "ssh1.h" 35#include "ssh1.h"
35#include "ssh2.h" 36#include "ssh2.h"
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index 2d56e7e4a..a7ced57e9 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -25,11 +25,14 @@
25 * 25 *
26 */ 26 */
27#include "includes.h" 27#include "includes.h"
28
29#include "xmalloc.h"
30#include "buffer.h"
31#include "key.h"
32#include "hostfile.h"
28#include "auth.h" 33#include "auth.h"
29#include "ssh.h" 34#include "ssh.h"
30#include "log.h" 35#include "log.h"
31#include "xmalloc.h"
32#include "buffer.h"
33 36
34#ifdef _AIX 37#ifdef _AIX
35 38
diff --git a/openbsd-compat/port-tun.h b/openbsd-compat/port-tun.h
index 86d9272b4..9f7a98614 100644
--- a/openbsd-compat/port-tun.h
+++ b/openbsd-compat/port-tun.h
@@ -17,8 +17,6 @@
17#ifndef _PORT_TUN_H 17#ifndef _PORT_TUN_H
18#define _PORT_TUN_H 18#define _PORT_TUN_H
19 19
20#include "channels.h"
21
22#if defined(SSH_TUN_LINUX) || defined(SSH_TUN_FREEBSD) 20#if defined(SSH_TUN_LINUX) || defined(SSH_TUN_FREEBSD)
23# define CUSTOM_SYS_TUN_OPEN 21# define CUSTOM_SYS_TUN_OPEN
24int sys_tun_open(int, int); 22int sys_tun_open(int, int);
diff --git a/packet.c b/packet.c
index acf72f77e..f2e03f800 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.141 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: packet.c,v 1.142 2006/08/03 03:34:42 deraadt 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
@@ -57,22 +57,20 @@
57#include <stdlib.h> 57#include <stdlib.h>
58#include <string.h> 58#include <string.h>
59#include <unistd.h> 59#include <unistd.h>
60#include <signal.h>
60 61
61#include "xmalloc.h" 62#include "xmalloc.h"
62#include "buffer.h" 63#include "buffer.h"
63#include "packet.h" 64#include "packet.h"
64#include "bufaux.h"
65#include "crc32.h" 65#include "crc32.h"
66
67#include "compress.h" 66#include "compress.h"
68#include "deattack.h" 67#include "deattack.h"
69#include "channels.h" 68#include "channels.h"
70
71#include "compat.h" 69#include "compat.h"
72#include "ssh1.h" 70#include "ssh1.h"
73#include "ssh2.h" 71#include "ssh2.h"
74
75#include "cipher.h" 72#include "cipher.h"
73#include "key.h"
76#include "kex.h" 74#include "kex.h"
77#include "mac.h" 75#include "mac.h"
78#include "log.h" 76#include "log.h"
diff --git a/progressmeter.c b/progressmeter.c
index e8534fa2f..0f95222d2 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: progressmeter.c,v 1.36 2006/08/01 23:36:12 stevesk Exp $ */ 1/* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Nils Nordman. All rights reserved. 3 * Copyright (c) 2003 Nils Nordman. All rights reserved.
4 * 4 *
@@ -27,6 +27,7 @@
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/ioctl.h> 29#include <sys/ioctl.h>
30#include <sys/uio.h>
30 31
31#include <errno.h> 32#include <errno.h>
32#include <signal.h> 33#include <signal.h>
diff --git a/readconf.c b/readconf.c
index 9975c9d32..c57ea0c82 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.158 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: readconf.c,v 1.159 2006/08/03 03:34:42 deraadt 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
@@ -23,19 +23,22 @@
23#include <ctype.h> 23#include <ctype.h>
24#include <errno.h> 24#include <errno.h>
25#include <netdb.h> 25#include <netdb.h>
26#include <signal.h>
26#include <stdio.h> 27#include <stdio.h>
27#include <string.h> 28#include <string.h>
28#include <unistd.h> 29#include <unistd.h>
29 30
30#include "ssh.h"
31#include "xmalloc.h" 31#include "xmalloc.h"
32#include "ssh.h"
32#include "compat.h" 33#include "compat.h"
33#include "cipher.h" 34#include "cipher.h"
34#include "pathnames.h" 35#include "pathnames.h"
35#include "log.h" 36#include "log.h"
37#include "key.h"
36#include "readconf.h" 38#include "readconf.h"
37#include "match.h" 39#include "match.h"
38#include "misc.h" 40#include "misc.h"
41#include "buffer.h"
39#include "kex.h" 42#include "kex.h"
40#include "mac.h" 43#include "mac.h"
41 44
diff --git a/readconf.h b/readconf.h
index e99b1ff25..d484f258e 100644
--- a/readconf.h
+++ b/readconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.h,v 1.70 2006/07/11 18:50:48 markus Exp $ */ 1/* $OpenBSD: readconf.h,v 1.71 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,8 +16,6 @@
16#ifndef READCONF_H 16#ifndef READCONF_H
17#define READCONF_H 17#define READCONF_H
18 18
19#include "key.h"
20
21/* Data structure for representing a forwarding request. */ 19/* Data structure for representing a forwarding request. */
22 20
23typedef struct { 21typedef struct {
diff --git a/readpass.c b/readpass.c
index 8af5d444d..bd144c2e3 100644
--- a/readpass.c
+++ b/readpass.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readpass.c,v 1.46 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: readpass.c,v 1.47 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
diff --git a/rsa.c b/rsa.c
index c656291ed..875b486c4 100644
--- a/rsa.c
+++ b/rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa.c,v 1.27 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: rsa.c,v 1.28 2006/08/03 03:34:42 deraadt 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
@@ -62,11 +62,13 @@
62 62
63#include "includes.h" 63#include "includes.h"
64 64
65#include <sys/types.h>
66
65#include <string.h> 67#include <string.h>
66 68
69#include "xmalloc.h"
67#include "rsa.h" 70#include "rsa.h"
68#include "log.h" 71#include "log.h"
69#include "xmalloc.h"
70 72
71void 73void
72rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key) 74rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
diff --git a/scard.c b/scard.c
index e22da596f..a2d28cba1 100644
--- a/scard.c
+++ b/scard.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scard.c,v 1.34 2006/08/01 23:36:12 stevesk Exp $ */ 1/* $OpenBSD: scard.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -26,14 +26,16 @@
26#include "includes.h" 26#include "includes.h"
27#if defined(SMARTCARD) && defined(USE_SECTOK) 27#if defined(SMARTCARD) && defined(USE_SECTOK)
28 28
29#include <openssl/evp.h> 29#include <sys/types.h>
30 30
31#include <sectok.h> 31#include <sectok.h>
32#include <string.h> 32#include <string.h>
33 33
34#include <openssl/evp.h>
35
36#include "xmalloc.h"
34#include "key.h" 37#include "key.h"
35#include "log.h" 38#include "log.h"
36#include "xmalloc.h"
37#include "misc.h" 39#include "misc.h"
38#include "scard.h" 40#include "scard.h"
39 41
diff --git a/scard.h b/scard.h
index 146182261..82efe4839 100644
--- a/scard.h
+++ b/scard.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: scard.h,v 1.13 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: scard.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -27,8 +27,6 @@
27#ifndef SCARD_H 27#ifndef SCARD_H
28#define SCARD_H 28#define SCARD_H
29 29
30#include "key.h"
31
32#define SCARD_ERROR_FAIL -1 30#define SCARD_ERROR_FAIL -1
33#define SCARD_ERROR_NOCARD -2 31#define SCARD_ERROR_NOCARD -2
34#define SCARD_ERROR_APPLET -3 32#define SCARD_ERROR_APPLET -3
diff --git a/scp.c b/scp.c
index 8d9de0135..56a3e79ff 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.154 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: scp.c,v 1.155 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -82,6 +82,7 @@
82# include <sys/time.h> 82# include <sys/time.h>
83#endif 83#endif
84#include <sys/wait.h> 84#include <sys/wait.h>
85#include <sys/uio.h>
85 86
86#include <ctype.h> 87#include <ctype.h>
87#include <dirent.h> 88#include <dirent.h>
diff --git a/servconf.c b/servconf.c
index b1fc45c50..5884b95be 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.c,v 1.163 2006/08/01 23:36:12 stevesk Exp $ */ 1/* $OpenBSD: servconf.c,v 1.164 2006/08/03 03:34:42 deraadt 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
@@ -19,16 +19,20 @@
19#include <stdio.h> 19#include <stdio.h>
20#include <stdlib.h> 20#include <stdlib.h>
21#include <string.h> 21#include <string.h>
22#include <signal.h>
22#include <unistd.h> 23#include <unistd.h>
24#include <stdarg.h>
23 25
26#include "xmalloc.h"
24#include "ssh.h" 27#include "ssh.h"
25#include "log.h" 28#include "log.h"
29#include "buffer.h"
26#include "servconf.h" 30#include "servconf.h"
27#include "xmalloc.h"
28#include "compat.h" 31#include "compat.h"
29#include "pathnames.h" 32#include "pathnames.h"
30#include "misc.h" 33#include "misc.h"
31#include "cipher.h" 34#include "cipher.h"
35#include "key.h"
32#include "kex.h" 36#include "kex.h"
33#include "mac.h" 37#include "mac.h"
34#include "match.h" 38#include "match.h"
diff --git a/servconf.h b/servconf.h
index 0add6518d..2593b1cd1 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.77 2006/07/21 12:43:36 dtucker Exp $ */ 1/* $OpenBSD: servconf.h,v 1.78 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,8 +16,6 @@
16#ifndef SERVCONF_H 16#ifndef SERVCONF_H
17#define SERVCONF_H 17#define SERVCONF_H
18 18
19#include "buffer.h"
20
21#define MAX_PORTS 256 /* Max # ports. */ 19#define MAX_PORTS 256 /* Max # ports. */
22 20
23#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 21#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */
diff --git a/serverloop.c b/serverloop.c
index 77c4a5a27..6e5fdc2d8 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.143 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.144 2006/08/03 03:34:42 deraadt 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 <string.h> 54#include <string.h>
55#include <termios.h> 55#include <termios.h>
56#include <unistd.h> 56#include <unistd.h>
57#include <stdarg.h>
57 58
58#include "xmalloc.h" 59#include "xmalloc.h"
59#include "packet.h" 60#include "packet.h"
@@ -66,13 +67,16 @@
66#include "compat.h" 67#include "compat.h"
67#include "ssh1.h" 68#include "ssh1.h"
68#include "ssh2.h" 69#include "ssh2.h"
70#include "key.h"
71#include "cipher.h"
72#include "kex.h"
73#include "hostfile.h"
69#include "auth.h" 74#include "auth.h"
70#include "session.h" 75#include "session.h"
71#include "dispatch.h" 76#include "dispatch.h"
72#include "auth-options.h" 77#include "auth-options.h"
73#include "serverloop.h" 78#include "serverloop.h"
74#include "misc.h" 79#include "misc.h"
75#include "kex.h"
76 80
77extern ServerOptions options; 81extern ServerOptions options;
78 82
diff --git a/session.c b/session.c
index a6d5ad257..1d63f9f50 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.215 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: session.c,v 1.216 2006/08/03 03:34:42 deraadt 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
@@ -58,10 +58,10 @@
58#include <string.h> 58#include <string.h>
59#include <unistd.h> 59#include <unistd.h>
60 60
61#include "xmalloc.h"
61#include "ssh.h" 62#include "ssh.h"
62#include "ssh1.h" 63#include "ssh1.h"
63#include "ssh2.h" 64#include "ssh2.h"
64#include "xmalloc.h"
65#include "sshpty.h" 65#include "sshpty.h"
66#include "packet.h" 66#include "packet.h"
67#include "buffer.h" 67#include "buffer.h"
@@ -69,7 +69,12 @@
69#include "uidswap.h" 69#include "uidswap.h"
70#include "compat.h" 70#include "compat.h"
71#include "channels.h" 71#include "channels.h"
72#include "bufaux.h" 72#include "key.h"
73#include "cipher.h"
74#ifdef GSSAPI
75#include "ssh-gss.h"
76#endif
77#include "hostfile.h"
73#include "auth.h" 78#include "auth.h"
74#include "auth-options.h" 79#include "auth-options.h"
75#include "pathnames.h" 80#include "pathnames.h"
@@ -86,10 +91,6 @@
86#include <kafs.h> 91#include <kafs.h>
87#endif 92#endif
88 93
89#ifdef GSSAPI
90#include "ssh-gss.h"
91#endif
92
93/* func */ 94/* func */
94 95
95Session *session_new(void); 96Session *session_new(void);
diff --git a/session.h b/session.h
index c3a12821f..ee9338e4f 100644
--- a/session.h
+++ b/session.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.h,v 1.28 2006/07/06 16:03:53 stevesk Exp $ */ 1/* $OpenBSD: session.h,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -26,10 +26,6 @@
26#ifndef SESSION_H 26#ifndef SESSION_H
27#define SESSION_H 27#define SESSION_H
28 28
29#include <sys/types.h>
30
31#include <pwd.h>
32
33#define TTYSZ 64 29#define TTYSZ 64
34typedef struct Session Session; 30typedef struct Session Session;
35struct Session { 31struct Session {
diff --git a/sftp-client.c b/sftp-client.c
index b7b126d21..e31b2cfaf 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.c,v 1.73 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sftp-client.c,v 1.74 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -24,25 +24,25 @@
24 24
25#include <sys/types.h> 25#include <sys/types.h>
26#include <sys/param.h> 26#include <sys/param.h>
27#include "openbsd-compat/sys-queue.h"
27#ifdef HAVE_SYS_STAT_H 28#ifdef HAVE_SYS_STAT_H
28# include <sys/stat.h> 29# include <sys/stat.h>
29#endif 30#endif
30#ifdef HAVE_SYS_TIME_H 31#ifdef HAVE_SYS_TIME_H
31# include <sys/time.h> 32# include <sys/time.h>
32#endif 33#endif
34#include <sys/uio.h>
33 35
34#include <errno.h> 36#include <errno.h>
35#include <fcntl.h> 37#include <fcntl.h>
36#include <signal.h> 38#include <signal.h>
39#include <stdarg.h>
37#include <stdio.h> 40#include <stdio.h>
38#include <string.h> 41#include <string.h>
39#include <unistd.h> 42#include <unistd.h>
40 43
41#include "openbsd-compat/sys-queue.h"
42
43#include "buffer.h"
44#include "bufaux.h"
45#include "xmalloc.h" 44#include "xmalloc.h"
45#include "buffer.h"
46#include "log.h" 46#include "log.h"
47#include "atomicio.h" 47#include "atomicio.h"
48#include "progressmeter.h" 48#include "progressmeter.h"
@@ -82,7 +82,7 @@ send_msg(int fd, Buffer *m)
82 iov[0].iov_len = sizeof(mlen); 82 iov[0].iov_len = sizeof(mlen);
83 iov[1].iov_base = buffer_ptr(m); 83 iov[1].iov_base = buffer_ptr(m);
84 iov[1].iov_len = buffer_len(m); 84 iov[1].iov_len = buffer_len(m);
85 85
86 if (atomiciov(writev, fd, iov, 2) != buffer_len(m) + sizeof(mlen)) 86 if (atomiciov(writev, fd, iov, 2) != buffer_len(m) + sizeof(mlen))
87 fatal("Couldn't send packet: %s", strerror(errno)); 87 fatal("Couldn't send packet: %s", strerror(errno));
88 88
diff --git a/sftp-common.c b/sftp-common.c
index 3faed373e..7ebadcc53 100644
--- a/sftp-common.c
+++ b/sftp-common.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-common.c,v 1.19 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sftp-common.c,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * Copyright (c) 2001 Damien Miller. All rights reserved. 4 * Copyright (c) 2001 Damien Miller. All rights reserved.
@@ -35,11 +35,11 @@
35#include <stdio.h> 35#include <stdio.h>
36#include <string.h> 36#include <string.h>
37#include <time.h> 37#include <time.h>
38#include <stdarg.h>
38 39
40#include "xmalloc.h"
39#include "buffer.h" 41#include "buffer.h"
40#include "bufaux.h"
41#include "log.h" 42#include "log.h"
42#include "xmalloc.h"
43 43
44#include "sftp.h" 44#include "sftp.h"
45#include "sftp-common.h" 45#include "sftp-common.h"
diff --git a/sftp-common.h b/sftp-common.h
index 9a64dc522..9b5848462 100644
--- a/sftp-common.h
+++ b/sftp-common.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-common.h,v 1.9 2006/07/10 16:01:57 stevesk Exp $ */ 1/* $OpenBSD: sftp-common.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -25,11 +25,6 @@
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/types.h>
29#include <sys/stat.h>
30
31#include "buffer.h"
32
33/* Maximum packet that we are willing to send/accept */ 28/* Maximum packet that we are willing to send/accept */
34#define SFTP_MAX_MSG_LENGTH (256 * 1024) 29#define SFTP_MAX_MSG_LENGTH (256 * 1024)
35 30
diff --git a/sftp-glob.c b/sftp-glob.c
index f8549ea76..cdc270827 100644
--- a/sftp-glob.c
+++ b/sftp-glob.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-glob.c,v 1.21 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: sftp-glob.c,v 1.22 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -26,8 +26,8 @@
26#include <string.h> 26#include <string.h>
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29
30#include "sftp.h" 29#include "sftp.h"
30#include "buffer.h"
31#include "sftp-common.h" 31#include "sftp-common.h"
32#include "sftp-client.h" 32#include "sftp-client.h"
33 33
diff --git a/sftp-server.c b/sftp-server.c
index c0839782d..c57958b0f 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-server.c,v 1.69 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sftp-server.c,v 1.70 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
4 * 4 *
@@ -14,6 +14,7 @@
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17
17#include "includes.h" 18#include "includes.h"
18 19
19#include <sys/types.h> 20#include <sys/types.h>
@@ -30,13 +31,14 @@
30#include <stdlib.h> 31#include <stdlib.h>
31#include <stdio.h> 32#include <stdio.h>
32#include <string.h> 33#include <string.h>
34#include <pwd.h>
33#include <time.h> 35#include <time.h>
34#include <unistd.h> 36#include <unistd.h>
37#include <stdarg.h>
35 38
39#include "xmalloc.h"
36#include "buffer.h" 40#include "buffer.h"
37#include "bufaux.h"
38#include "log.h" 41#include "log.h"
39#include "xmalloc.h"
40#include "misc.h" 42#include "misc.h"
41#include "uidswap.h" 43#include "uidswap.h"
42 44
@@ -135,7 +137,7 @@ string_from_portable(int pflags)
135#define PAPPEND(str) { \ 137#define PAPPEND(str) { \
136 if (*ret != '\0') \ 138 if (*ret != '\0') \
137 strlcat(ret, ",", sizeof(ret)); \ 139 strlcat(ret, ",", sizeof(ret)); \
138 strlcat(ret, str, sizeof(ret)); \ 140 strlcat(ret, str, sizeof(ret)); \
139 } 141 }
140 142
141 if (pflags & SSH2_FXF_READ) 143 if (pflags & SSH2_FXF_READ)
@@ -1225,7 +1227,7 @@ main(int argc, char **argv)
1225 case 'c': 1227 case 'c':
1226 /* 1228 /*
1227 * Ignore all arguments if we are invoked as a 1229 * Ignore all arguments if we are invoked as a
1228 * shell using "sftp-server -c command" 1230 * shell using "sftp-server -c command"
1229 */ 1231 */
1230 skipargs = 1; 1232 skipargs = 1;
1231 break; 1233 break;
diff --git a/sftp.c b/sftp.c
index 82ef58019..cf3dea048 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.90 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sftp.c,v 1.91 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -18,10 +18,10 @@
18#include "includes.h" 18#include "includes.h"
19 19
20#include <sys/types.h> 20#include <sys/types.h>
21#include <sys/ioctl.h>
21#ifdef HAVE_SYS_STAT_H 22#ifdef HAVE_SYS_STAT_H
22# include <sys/stat.h> 23# include <sys/stat.h>
23#endif 24#endif
24#include <sys/ioctl.h>
25#include <sys/param.h> 25#include <sys/param.h>
26#include <sys/socket.h> 26#include <sys/socket.h>
27#include <sys/wait.h> 27#include <sys/wait.h>
@@ -41,6 +41,7 @@ typedef void EditLine;
41#include <stdio.h> 41#include <stdio.h>
42#include <string.h> 42#include <string.h>
43#include <unistd.h> 43#include <unistd.h>
44#include <stdarg.h>
44 45
45#include "xmalloc.h" 46#include "xmalloc.h"
46#include "log.h" 47#include "log.h"
@@ -48,6 +49,7 @@ typedef void EditLine;
48#include "misc.h" 49#include "misc.h"
49 50
50#include "sftp.h" 51#include "sftp.h"
52#include "buffer.h"
51#include "sftp-common.h" 53#include "sftp-common.h"
52#include "sftp-client.h" 54#include "sftp-client.h"
53 55
diff --git a/ssh-add.c b/ssh-add.c
index a8d98fd1f..518f47066 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.88 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: ssh-add.c,v 1.89 2006/08/03 03:34:42 deraadt 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
@@ -50,11 +50,12 @@
50#include <string.h> 50#include <string.h>
51#include <unistd.h> 51#include <unistd.h>
52 52
53#include "xmalloc.h"
53#include "ssh.h" 54#include "ssh.h"
54#include "rsa.h" 55#include "rsa.h"
55#include "log.h" 56#include "log.h"
56#include "xmalloc.h"
57#include "key.h" 57#include "key.h"
58#include "buffer.h"
58#include "authfd.h" 59#include "authfd.h"
59#include "authfile.h" 60#include "authfile.h"
60#include "pathnames.h" 61#include "pathnames.h"
diff --git a/ssh-agent.c b/ssh-agent.c
index 54c2b9c47..e43faae42 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.150 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.151 2006/08/03 03:34:42 deraadt 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
@@ -64,11 +64,10 @@
64#include <string.h> 64#include <string.h>
65#include <unistd.h> 65#include <unistd.h>
66 66
67#include "xmalloc.h"
67#include "ssh.h" 68#include "ssh.h"
68#include "rsa.h" 69#include "rsa.h"
69#include "buffer.h" 70#include "buffer.h"
70#include "bufaux.h"
71#include "xmalloc.h"
72#include "key.h" 71#include "key.h"
73#include "authfd.h" 72#include "authfd.h"
74#include "compat.h" 73#include "compat.h"
diff --git a/ssh-dss.c b/ssh-dss.c
index a8d45a2b4..448f704f6 100644
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-dss.c,v 1.22 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: ssh-dss.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -25,6 +25,8 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h>
29
28#include <openssl/bn.h> 30#include <openssl/bn.h>
29#include <openssl/evp.h> 31#include <openssl/evp.h>
30 32
@@ -32,7 +34,6 @@
32 34
33#include "xmalloc.h" 35#include "xmalloc.h"
34#include "buffer.h" 36#include "buffer.h"
35#include "bufaux.h"
36#include "compat.h" 37#include "compat.h"
37#include "log.h" 38#include "log.h"
38#include "key.h" 39#include "key.h"
diff --git a/ssh-gss.h b/ssh-gss.h
index d3fd79bf2..0837c9b76 100644
--- a/ssh-gss.h
+++ b/ssh-gss.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-gss.h,v 1.6 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: ssh-gss.h,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 3 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
4 * 4 *
@@ -28,8 +28,6 @@
28 28
29#ifdef GSSAPI 29#ifdef GSSAPI
30 30
31#include "buffer.h"
32
33#ifdef HAVE_GSSAPI_H 31#ifdef HAVE_GSSAPI_H
34#include <gssapi.h> 32#include <gssapi.h>
35#elif defined(HAVE_GSSAPI_GSSAPI_H) 33#elif defined(HAVE_GSSAPI_GSSAPI_H)
diff --git a/ssh-keygen.c b/ssh-keygen.c
index d8b793e81..c607e257e 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.153 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.154 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -40,7 +40,6 @@
40#include "authfile.h" 40#include "authfile.h"
41#include "uuencode.h" 41#include "uuencode.h"
42#include "buffer.h" 42#include "buffer.h"
43#include "bufaux.h"
44#include "pathnames.h" 43#include "pathnames.h"
45#include "log.h" 44#include "log.h"
46#include "misc.h" 45#include "misc.h"
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 701540841..64d4d0870 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keyscan.c,v 1.72 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: ssh-keyscan.c,v 1.73 2006/08/03 03:34:42 deraadt 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 *
@@ -23,20 +23,21 @@
23#include <stdarg.h> 23#include <stdarg.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include <signal.h>
26#include <string.h> 27#include <string.h>
27#include <unistd.h> 28#include <unistd.h>
28 29
29#include "xmalloc.h" 30#include "xmalloc.h"
30#include "ssh.h" 31#include "ssh.h"
31#include "ssh1.h" 32#include "ssh1.h"
33#include "buffer.h"
32#include "key.h" 34#include "key.h"
35#include "cipher.h"
33#include "kex.h" 36#include "kex.h"
34#include "compat.h" 37#include "compat.h"
35#include "myproposal.h" 38#include "myproposal.h"
36#include "packet.h" 39#include "packet.h"
37#include "dispatch.h" 40#include "dispatch.h"
38#include "buffer.h"
39#include "bufaux.h"
40#include "log.h" 41#include "log.h"
41#include "atomicio.h" 42#include "atomicio.h"
42#include "misc.h" 43#include "misc.h"
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 89fdbda36..1ddb2a058 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keysign.c,v 1.28 2006/07/26 13:57:17 stevesk Exp $ */ 1/* $OpenBSD: ssh-keysign.c,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -22,6 +22,7 @@
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25
25#include "includes.h" 26#include "includes.h"
26 27
27#include <fcntl.h> 28#include <fcntl.h>
@@ -37,14 +38,13 @@
37#include <openssl/rand.h> 38#include <openssl/rand.h>
38#include <openssl/rsa.h> 39#include <openssl/rsa.h>
39 40
41#include "xmalloc.h"
40#include "log.h" 42#include "log.h"
41#include "key.h" 43#include "key.h"
42#include "ssh.h" 44#include "ssh.h"
43#include "ssh2.h" 45#include "ssh2.h"
44#include "misc.h" 46#include "misc.h"
45#include "xmalloc.h"
46#include "buffer.h" 47#include "buffer.h"
47#include "bufaux.h"
48#include "authfile.h" 48#include "authfile.h"
49#include "msg.h" 49#include "msg.h"
50#include "canohost.h" 50#include "canohost.h"
diff --git a/ssh-rsa.c b/ssh-rsa.c
index 236f77aac..28444c1f9 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-rsa.c,v 1.38 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: ssh-rsa.c,v 1.39 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
4 * 4 *
@@ -14,8 +14,11 @@
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17
17#include "includes.h" 18#include "includes.h"
18 19
20#include <sys/types.h>
21
19#include <openssl/evp.h> 22#include <openssl/evp.h>
20#include <openssl/err.h> 23#include <openssl/err.h>
21 24
@@ -24,7 +27,6 @@
24#include "xmalloc.h" 27#include "xmalloc.h"
25#include "log.h" 28#include "log.h"
26#include "buffer.h" 29#include "buffer.h"
27#include "bufaux.h"
28#include "key.h" 30#include "key.h"
29#include "compat.h" 31#include "compat.h"
30#include "ssh.h" 32#include "ssh.h"
diff --git a/ssh.c b/ssh.c
index 10dd8777a..07a4ca3c8 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.292 2006/08/01 23:36:12 stevesk Exp $ */ 1/* $OpenBSD: ssh.c,v 1.293 2006/08/03 03:34:42 deraadt 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
@@ -69,15 +69,14 @@
69#include <openssl/evp.h> 69#include <openssl/evp.h>
70#include <openssl/err.h> 70#include <openssl/err.h>
71 71
72#include "xmalloc.h"
72#include "ssh.h" 73#include "ssh.h"
73#include "ssh1.h" 74#include "ssh1.h"
74#include "ssh2.h" 75#include "ssh2.h"
75#include "compat.h" 76#include "compat.h"
76#include "cipher.h" 77#include "cipher.h"
77#include "xmalloc.h"
78#include "packet.h" 78#include "packet.h"
79#include "buffer.h" 79#include "buffer.h"
80#include "bufaux.h"
81#include "channels.h" 80#include "channels.h"
82#include "key.h" 81#include "key.h"
83#include "authfd.h" 82#include "authfd.h"
@@ -1256,7 +1255,7 @@ load_public_identity_files(void)
1256 cp = tilde_expand_filename(options.identity_files[i], 1255 cp = tilde_expand_filename(options.identity_files[i],
1257 original_real_uid); 1256 original_real_uid);
1258 filename = percent_expand(cp, "d", pw->pw_dir, 1257 filename = percent_expand(cp, "d", pw->pw_dir,
1259 "u", pw->pw_name, "l", thishost, "h", host, 1258 "u", pw->pw_name, "l", thishost, "h", host,
1260 "r", options.user, (char *)NULL); 1259 "r", options.user, (char *)NULL);
1261 xfree(cp); 1260 xfree(cp);
1262 public = key_load_public(filename, NULL); 1261 public = key_load_public(filename, NULL);
diff --git a/ssh.h b/ssh.h
index ed5fb9aaa..186cfff96 100644
--- a/ssh.h
+++ b/ssh.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.h,v 1.77 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: ssh.h,v 1.78 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -12,18 +12,6 @@
12 * called by a name other than "ssh" or "Secure Shell". 12 * called by a name other than "ssh" or "Secure Shell".
13 */ 13 */
14 14
15#ifndef SSH_H
16#define SSH_H
17
18#include <netinet/in.h> /* For struct sockaddr_in */
19#include <pwd.h> /* For struct pw */
20#include <stdarg.h> /* For va_list */
21#include <syslog.h> /* For LOG_AUTH and friends */
22#include <sys/socket.h> /* For struct sockaddr_storage */
23#ifdef HAVE_SYS_SELECT_H
24# include <sys/select.h>
25#endif
26
27/* Cipher used for encrypting authentication files. */ 15/* Cipher used for encrypting authentication files. */
28#define SSH_AUTHFILE_CIPHER SSH_CIPHER_3DES 16#define SSH_AUTHFILE_CIPHER SSH_CIPHER_3DES
29 17
@@ -112,5 +100,3 @@
112 100
113/* Listen backlog for sshd, ssh-agent and forwarding sockets */ 101/* Listen backlog for sshd, ssh-agent and forwarding sockets */
114#define SSH_LISTEN_BACKLOG 128 102#define SSH_LISTEN_BACKLOG 128
115
116#endif /* SSH_H */
diff --git a/sshconnect.c b/sshconnect.c
index af75bba8d..71ca4ec52 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.198 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.199 2006/08/03 03:34:42 deraadt 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
@@ -37,8 +37,10 @@
37#include <string.h> 37#include <string.h>
38#include <unistd.h> 38#include <unistd.h>
39 39
40#include "ssh.h"
41#include "xmalloc.h" 40#include "xmalloc.h"
41#include "key.h"
42#include "hostfile.h"
43#include "ssh.h"
42#include "rsa.h" 44#include "rsa.h"
43#include "buffer.h" 45#include "buffer.h"
44#include "packet.h" 46#include "packet.h"
diff --git a/sshconnect.h b/sshconnect.h
index 0b3896f9d..4e66bbffc 100644
--- a/sshconnect.h
+++ b/sshconnect.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.h,v 1.22 2006/07/08 21:47:12 stevesk Exp $ */ 1/* $OpenBSD: sshconnect.h,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -23,13 +23,6 @@
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26#ifndef SSHCONNECT_H
27#define SSHCONNECT_H
28
29#include <sys/types.h>
30#include <sys/socket.h>
31
32#include <pwd.h>
33 26
34typedef struct Sensitive Sensitive; 27typedef struct Sensitive Sensitive;
35struct Sensitive { 28struct Sensitive {
@@ -74,5 +67,3 @@ int ssh_local_cmd(const char *);
74 strerror(errno)); \ 67 strerror(errno)); \
75 errno = save_errno; \ 68 errno = save_errno; \
76} while (0) 69} while (0)
77
78#endif
diff --git a/sshconnect1.c b/sshconnect1.c
index f0eee3bdf..51f1f8088 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect1.c,v 1.68 2006/08/01 23:22:47 stevesk Exp $ */ 1/* $OpenBSD: sshconnect1.c,v 1.69 2006/08/03 03:34:42 deraadt 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
@@ -15,30 +15,36 @@
15 15
16#include "includes.h" 16#include "includes.h"
17 17
18#include <sys/types.h>
19#include <sys/socket.h>
20
18#include <openssl/bn.h> 21#include <openssl/bn.h>
19#include <openssl/md5.h> 22#include <openssl/md5.h>
20 23
21#include <stdio.h> 24#include <stdio.h>
22#include <stdlib.h> 25#include <stdlib.h>
23#include <string.h> 26#include <string.h>
27#include <signal.h>
28#include <pwd.h>
24 29
30#include "xmalloc.h"
25#include "ssh.h" 31#include "ssh.h"
26#include "ssh1.h" 32#include "ssh1.h"
27#include "xmalloc.h"
28#include "rsa.h" 33#include "rsa.h"
29#include "buffer.h" 34#include "buffer.h"
30#include "packet.h" 35#include "packet.h"
36#include "key.h"
37#include "cipher.h"
31#include "kex.h" 38#include "kex.h"
32#include "uidswap.h" 39#include "uidswap.h"
33#include "log.h" 40#include "log.h"
34#include "readconf.h" 41#include "readconf.h"
35#include "key.h"
36#include "authfd.h" 42#include "authfd.h"
37#include "sshconnect.h" 43#include "sshconnect.h"
38#include "authfile.h" 44#include "authfile.h"
39#include "misc.h" 45#include "misc.h"
40#include "cipher.h"
41#include "canohost.h" 46#include "canohost.h"
47#include "hostfile.h"
42#include "auth.h" 48#include "auth.h"
43 49
44/* Session id for the current session. */ 50/* Session id for the current session. */
diff --git a/sshconnect2.c b/sshconnect2.c
index 27e5442e9..e58d078c4 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.159 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.160 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -26,24 +26,27 @@
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/socket.h>
29#include <sys/wait.h> 30#include <sys/wait.h>
30#include <sys/stat.h> 31#include <sys/stat.h>
31 32
32#include <errno.h> 33#include <errno.h>
34#include <pwd.h>
35#include <signal.h>
33#include <stdio.h> 36#include <stdio.h>
34#include <string.h> 37#include <string.h>
35#include <unistd.h> 38#include <unistd.h>
36 39
37#include "openbsd-compat/sys-queue.h" 40#include "openbsd-compat/sys-queue.h"
38 41
42#include "xmalloc.h"
39#include "ssh.h" 43#include "ssh.h"
40#include "ssh2.h" 44#include "ssh2.h"
41#include "xmalloc.h"
42#include "buffer.h" 45#include "buffer.h"
43#include "packet.h" 46#include "packet.h"
44#include "compat.h" 47#include "compat.h"
45#include "bufaux.h"
46#include "cipher.h" 48#include "cipher.h"
49#include "key.h"
47#include "kex.h" 50#include "kex.h"
48#include "myproposal.h" 51#include "myproposal.h"
49#include "sshconnect.h" 52#include "sshconnect.h"
diff --git a/sshd.c b/sshd.c
index 5cefd1024..52c21e500 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.342 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: sshd.c,v 1.343 2006/08/03 03:34:42 deraadt 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
@@ -45,14 +45,15 @@
45#include "includes.h" 45#include "includes.h"
46 46
47#include <sys/types.h> 47#include <sys/types.h>
48#include <sys/ioctl.h>
49#include <sys/socket.h>
48#ifdef HAVE_SYS_STAT_H 50#ifdef HAVE_SYS_STAT_H
49# include <sys/stat.h> 51# include <sys/stat.h>
50#endif 52#endif
51#include <sys/ioctl.h>
52#include <sys/socket.h>
53#ifdef HAVE_SYS_TIME_H 53#ifdef HAVE_SYS_TIME_H
54# include <sys/time.h> 54# include <sys/time.h>
55#endif 55#endif
56#include "openbsd-compat/sys-tree.h"
56#include <sys/wait.h> 57#include <sys/wait.h>
57 58
58#include <errno.h> 59#include <errno.h>
@@ -77,28 +78,28 @@
77#include <prot.h> 78#include <prot.h>
78#endif 79#endif
79 80
81#include "xmalloc.h"
80#include "ssh.h" 82#include "ssh.h"
81#include "ssh1.h" 83#include "ssh1.h"
82#include "ssh2.h" 84#include "ssh2.h"
83#include "xmalloc.h"
84#include "rsa.h" 85#include "rsa.h"
85#include "sshpty.h" 86#include "sshpty.h"
86#include "packet.h" 87#include "packet.h"
87#include "log.h" 88#include "log.h"
89#include "buffer.h"
88#include "servconf.h" 90#include "servconf.h"
89#include "uidswap.h" 91#include "uidswap.h"
90#include "compat.h" 92#include "compat.h"
91#include "buffer.h"
92#include "bufaux.h"
93#include "cipher.h" 93#include "cipher.h"
94#include "kex.h"
95#include "key.h" 94#include "key.h"
95#include "kex.h"
96#include "dh.h" 96#include "dh.h"
97#include "myproposal.h" 97#include "myproposal.h"
98#include "authfile.h" 98#include "authfile.h"
99#include "pathnames.h" 99#include "pathnames.h"
100#include "atomicio.h" 100#include "atomicio.h"
101#include "canohost.h" 101#include "canohost.h"
102#include "hostfile.h"
102#include "auth.h" 103#include "auth.h"
103#include "misc.h" 104#include "misc.h"
104#include "msg.h" 105#include "msg.h"
@@ -107,6 +108,9 @@
107#include "session.h" 108#include "session.h"
108#include "monitor_mm.h" 109#include "monitor_mm.h"
109#include "monitor.h" 110#include "monitor.h"
111#ifdef GSSAPI
112#include "ssh-gss.h"
113#endif
110#include "monitor_wrap.h" 114#include "monitor_wrap.h"
111#include "monitor_fdpass.h" 115#include "monitor_fdpass.h"
112#include "version.h" 116#include "version.h"
diff --git a/sshlogin.c b/sshlogin.c
index b01fde091..fba8a4d24 100644
--- a/sshlogin.c
+++ b/sshlogin.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshlogin.c,v 1.24 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: sshlogin.c,v 1.25 2006/08/03 03:34:42 deraadt 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
@@ -43,9 +43,11 @@
43 43
44#include <sys/types.h> 44#include <sys/types.h>
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/socket.h>
46 47
47#include <errno.h> 48#include <errno.h>
48#include <fcntl.h> 49#include <fcntl.h>
50#include <stdarg.h>
49#include <stdio.h> 51#include <stdio.h>
50#include <string.h> 52#include <string.h>
51#include <time.h> 53#include <time.h>
diff --git a/sshlogin.h b/sshlogin.h
index c0f9cd300..500d3fefd 100644
--- a/sshlogin.h
+++ b/sshlogin.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshlogin.h,v 1.7 2006/07/08 21:47:12 stevesk Exp $ */ 1/* $OpenBSD: sshlogin.h,v 1.8 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -11,11 +11,6 @@
11 * incompatible with the protocol description in the RFC file, it must be 11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell". 12 * called by a name other than "ssh" or "Secure Shell".
13 */ 13 */
14#ifndef SSHLOGIN_H
15#define SSHLOGIN_H
16
17#include <sys/types.h>
18#include <sys/socket.h>
19 14
20void record_login(pid_t, const char *, const char *, uid_t, 15void record_login(pid_t, const char *, const char *, uid_t,
21 const char *, struct sockaddr *, socklen_t); 16 const char *, struct sockaddr *, socklen_t);
@@ -26,5 +21,3 @@ time_t get_last_login_time(uid_t, const char *, char *, u_int);
26void record_utmp_only(pid_t, const char *, const char *, const char *, 21void record_utmp_only(pid_t, const char *, const char *, const char *,
27 struct sockaddr *, socklen_t); 22 struct sockaddr *, socklen_t);
28#endif 23#endif
29
30#endif
diff --git a/sshpty.c b/sshpty.c
index 719a79303..79c62ee9c 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshpty.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: sshpty.c,v 1.26 2006/08/03 03:34:42 deraadt 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
@@ -14,8 +14,8 @@
14 14
15#include "includes.h" 15#include "includes.h"
16 16
17#include <sys/ioctl.h>
18#include <sys/types.h> 17#include <sys/types.h>
18#include <sys/ioctl.h>
19#include <sys/stat.h> 19#include <sys/stat.h>
20#include <signal.h> 20#include <signal.h>
21 21
@@ -26,11 +26,12 @@
26# include <paths.h> 26# include <paths.h>
27#endif 27#endif
28#include <pwd.h> 28#include <pwd.h>
29#include <stdarg.h>
29#include <string.h> 30#include <string.h>
30#include <termios.h> 31#include <termios.h>
31#ifdef HAVE_UTIL_H 32#ifdef HAVE_UTIL_H
32# include <util.h> 33# include <util.h>
33#endif /* HAVE_UTIL_H */ 34#endif
34#include <unistd.h> 35#include <unistd.h>
35 36
36#include "sshpty.h" 37#include "sshpty.h"
diff --git a/sshpty.h b/sshpty.h
index a7b337474..7fac622d9 100644
--- a/sshpty.h
+++ b/sshpty.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshpty.h,v 1.9 2006/07/06 16:03:53 stevesk Exp $ */ 1/* $OpenBSD: sshpty.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -14,12 +14,6 @@
14 * called by a name other than "ssh" or "Secure Shell". 14 * called by a name other than "ssh" or "Secure Shell".
15 */ 15 */
16 16
17#ifndef SSHPTY_H
18#define SSHPTY_H
19
20#include <sys/types.h>
21
22#include <pwd.h>
23#include <termios.h> 17#include <termios.h>
24 18
25struct termios get_saved_tio(void); 19struct termios get_saved_tio(void);
@@ -31,5 +25,3 @@ void pty_release(const char *);
31void pty_make_controlling_tty(int *, const char *); 25void pty_make_controlling_tty(int *, const char *);
32void pty_change_window_size(int, u_int, u_int, u_int, u_int); 26void pty_change_window_size(int, u_int, u_int, u_int, u_int);
33void pty_setowner(struct passwd *, const char *); 27void pty_setowner(struct passwd *, const char *);
34
35#endif /* SSHPTY_H */
diff --git a/sshtty.c b/sshtty.c
index 70668afde..04567669b 100644
--- a/sshtty.c
+++ b/sshtty.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshtty.c,v 1.11 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: sshtty.c,v 1.12 2006/08/03 03:34:42 deraadt 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
@@ -37,8 +37,10 @@
37 37
38#include "includes.h" 38#include "includes.h"
39 39
40#include <sys/types.h>
40#include <stdio.h> 41#include <stdio.h>
41#include <termios.h> 42#include <termios.h>
43#include <pwd.h>
42 44
43#include "sshpty.h" 45#include "sshpty.h"
44 46
diff --git a/ttymodes.c b/ttymodes.c
index 680909b22..d8e2c553a 100644
--- a/ttymodes.c
+++ b/ttymodes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ttymodes.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */ 1/* $OpenBSD: ttymodes.c,v 1.26 2006/08/03 03:34:42 deraadt 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
@@ -45,16 +45,18 @@
45 45
46#include "includes.h" 46#include "includes.h"
47 47
48#include <sys/types.h>
49
48#include <errno.h> 50#include <errno.h>
49#include <string.h> 51#include <string.h>
50#include <termios.h> 52#include <termios.h>
53#include <stdarg.h>
51 54
52#include "packet.h" 55#include "packet.h"
53#include "log.h" 56#include "log.h"
54#include "ssh1.h" 57#include "ssh1.h"
55#include "compat.h" 58#include "compat.h"
56#include "buffer.h" 59#include "buffer.h"
57#include "bufaux.h"
58 60
59#define TTY_OP_END 0 61#define TTY_OP_END 0
60/* 62/*
diff --git a/uidswap.c b/uidswap.c
index 878258704..91d878c30 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: uidswap.c,v 1.34 2006/07/26 02:35:17 stevesk Exp $ */ 1/* $OpenBSD: uidswap.c,v 1.35 2006/08/03 03:34:42 deraadt 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
@@ -14,13 +14,12 @@
14 14
15#include "includes.h" 15#include "includes.h"
16 16
17#include <sys/types.h>
18#include <sys/param.h> 17#include <sys/param.h>
19
20#include <errno.h> 18#include <errno.h>
21#include <pwd.h> 19#include <pwd.h>
22#include <string.h> 20#include <string.h>
23#include <unistd.h> 21#include <unistd.h>
22#include <stdarg.h>
24 23
25#include <grp.h> 24#include <grp.h>
26 25
diff --git a/uidswap.h b/uidswap.h
index 436c10f75..1c1163d75 100644
--- a/uidswap.h
+++ b/uidswap.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: uidswap.h,v 1.12 2006/07/06 16:03:53 stevesk Exp $ */ 1/* $OpenBSD: uidswap.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -12,16 +12,7 @@
12 * called by a name other than "ssh" or "Secure Shell". 12 * called by a name other than "ssh" or "Secure Shell".
13 */ 13 */
14 14
15#ifndef UIDSWAP_H
16#define UIDSWAP_H
17
18#include <sys/types.h>
19
20#include <pwd.h>
21
22void temporarily_use_uid(struct passwd *); 15void temporarily_use_uid(struct passwd *);
23void restore_uid(void); 16void restore_uid(void);
24void permanently_set_uid(struct passwd *); 17void permanently_set_uid(struct passwd *);
25void permanently_drop_suid(uid_t); 18void permanently_drop_suid(uid_t);
26
27#endif /* UIDSWAP_H */
diff --git a/uuencode.c b/uuencode.c
index 8a6742e95..a13949585 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: uuencode.c,v 1.23 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: uuencode.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -26,9 +26,7 @@
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29
30#include <netinet/in.h> 29#include <netinet/in.h>
31
32#include <resolv.h> 30#include <resolv.h>
33#include <stdio.h> 31#include <stdio.h>
34 32
diff --git a/uuencode.h b/uuencode.h
index df09eb59b..fec55b491 100644
--- a/uuencode.h
+++ b/uuencode.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: uuencode.h,v 1.12 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: uuencode.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -24,12 +24,6 @@
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#ifndef UUENCODE_H
28#define UUENCODE_H
29
30#include <stdio.h>
31
32int uuencode(const u_char *, u_int, char *, size_t); 27int uuencode(const u_char *, u_int, char *, size_t);
33int uudecode(const char *, u_char *, size_t); 28int uudecode(const char *, u_char *, size_t);
34void dump_base64(FILE *, u_char *, u_int); 29void dump_base64(FILE *, u_char *, u_int);
35#endif
diff --git a/xmalloc.c b/xmalloc.c
index 6aea495ef..9985b4cc2 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: xmalloc.c,v 1.26 2006/08/01 23:22:48 stevesk Exp $ */ 1/* $OpenBSD: xmalloc.c,v 1.27 2006/08/03 03:34:42 deraadt 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
@@ -16,7 +16,6 @@
16#include "includes.h" 16#include "includes.h"
17 17
18#include <sys/param.h> 18#include <sys/param.h>
19
20#include <stdarg.h> 19#include <stdarg.h>
21#include <stdio.h> 20#include <stdio.h>
22#include <stdlib.h> 21#include <stdlib.h>
diff --git a/xmalloc.h b/xmalloc.h
index 27f25d584..fb217a45c 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: xmalloc.h,v 1.12 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: xmalloc.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,9 +16,6 @@
16 * called by a name other than "ssh" or "Secure Shell". 16 * called by a name other than "ssh" or "Secure Shell".
17 */ 17 */
18 18
19#ifndef XMALLOC_H
20#define XMALLOC_H
21
22void *xmalloc(size_t); 19void *xmalloc(size_t);
23void *xcalloc(size_t, size_t); 20void *xcalloc(size_t, size_t);
24void *xrealloc(void *, size_t, size_t); 21void *xrealloc(void *, size_t, size_t);
@@ -27,5 +24,3 @@ char *xstrdup(const char *);
27int xasprintf(char **, const char *, ...) 24int xasprintf(char **, const char *, ...)
28 __attribute__((__format__ (printf, 2, 3))) 25 __attribute__((__format__ (printf, 2, 3)))
29 __attribute__((__nonnull__ (2))); 26 __attribute__((__nonnull__ (2)));
30
31#endif /* XMALLOC_H */