- stevesk@cvs.openbsd.org 2006/08/01 23:36:12
[authfile.c channels.c progressmeter.c scard.c servconf.c ssh.c]
clean extra spaces
+ - deraadt@cvs.openbsd.org 2006/08/03 03:34:42
+ [OVERVIEW atomicio.c atomicio.h auth-bsdauth.c auth-chall.c auth-krb5.c]
+ [auth-options.c auth-options.h auth-passwd.c auth-rh-rsa.c auth-rhosts.c]
+ [auth-rsa.c auth-skey.c auth.c auth.h auth1.c auth2-chall.c auth2-gss.c]
+ [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c ]
+ [auth2-pubkey.c auth2.c authfd.c authfd.h authfile.c bufaux.c bufbn.c]
+ [buffer.c buffer.h canohost.c channels.c channels.h cipher-3des1.c]
+ [cipher-bf1.c cipher-ctr.c cipher.c cleanup.c clientloop.c compat.c]
+ [compress.c deattack.c dh.c dispatch.c dns.c dns.h fatal.c groupaccess.c]
+ [groupaccess.h gss-genr.c gss-serv-krb5.c gss-serv.c hostfile.c kex.c]
+ [kex.h kexdh.c kexdhc.c kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c]
+ [key.h log.c log.h mac.c match.c md-sha256.c misc.c misc.h moduli.c]
+ [monitor.c monitor_fdpass.c monitor_mm.c monitor_mm.h monitor_wrap.c]
+ [monitor_wrap.h msg.c nchan.c packet.c progressmeter.c readconf.c]
+ [readconf.h readpass.c rsa.c scard.c scard.h scp.c servconf.c servconf.h]
+ [serverloop.c session.c session.h sftp-client.c sftp-common.c]
+ [sftp-common.h sftp-glob.c sftp-server.c sftp.c ssh-add.c ssh-agent.c]
+ [ssh-dss.c ssh-gss.h ssh-keygen.c ssh-keyscan.c ssh-keysign.c ssh-rsa.c]
+ [ssh.c ssh.h sshconnect.c sshconnect.h sshconnect1.c sshconnect2.c]
+ [sshd.c sshlogin.c sshlogin.h sshpty.c sshpty.h sshtty.c ttymodes.c]
+ [uidswap.c uidswap.h uuencode.c uuencode.h xmalloc.c xmalloc.h]
+ [loginrec.c loginrec.h openbsd-compat/port-aix.c openbsd-compat/port-tun.h]
+ almost entirely get rid of the culture of ".h files that include .h files"
+ ok djm, sort of ok stevesk
+ makes the pain stop in one easy step
+ NB. portable commit contains everything *except* removing includes.h, as
+ that will take a fair bit more work as we move headers that are required
+ for portability workarounds to defines.h. (also, this step wasn't "easy")
20060804
- (dtucker) [configure.ac] The "crippled AES" test does not work on recent
- There are several other files in the distribution that contain
various auxiliary routines:
ssh.h the main header file for ssh (various definitions)
- includes.h includes most system headers. Lots of #ifdefs.
uidswap.c uid-swapping
xmalloc.c "safe" malloc routines
-$OpenBSD: OVERVIEW,v 1.10 2006/04/01 05:37:46 djm Exp $
+$OpenBSD: OVERVIEW,v 1.11 2006/08/03 03:34:41 deraadt Exp $
-/* $OpenBSD: atomicio.c,v 1.22 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: atomicio.c,v 1.23 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Damien Miller. All rights reserved.
* Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
#include "includes.h"
#include <sys/param.h>
+#include <sys/uio.h>
#include <errno.h>
#include <string.h>
-/* $OpenBSD: atomicio.h,v 1.9 2006/07/30 20:15:19 stevesk Exp $ */
+/* $OpenBSD: atomicio.h,v 1.10 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Damien Miller. All rights reserved.
#ifndef _ATOMICIO_H
#define _ATOMICIO_H
-#include <sys/types.h>
-#include <sys/uio.h>
-
-#include <unistd.h>
-
/*
* Ensure all of data on socket comes through. f==read || f==vwrite
*/
-/* $OpenBSD: auth-bsdauth.c,v 1.9 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth-bsdauth.c,v 1.10 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
+#include <sys/types.h>
+
#ifdef BSD_AUTH
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "log.h"
+#include "buffer.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
static void *
-/* $OpenBSD: auth-chall.c,v 1.11 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth-chall.c,v 1.12 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
+#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "log.h"
-#include "xmalloc.h"
#include "servconf.h"
/* limited protocol v1 interface to kbd-interactive authentication */
-/* $OpenBSD: auth-krb5.c,v 1.18 2006/05/06 08:35:40 dtucker Exp $ */
+/* $OpenBSD: auth-krb5.c,v 1.19 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Kerberos v5 authentication and ticket-passing routines.
*
#include "includes.h"
+#include <sys/types.h>
+#include <pwd.h>
+#include <stdarg.h>
+
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "packet.h"
-#include "xmalloc.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
#include "uidswap.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#ifdef KRB5
-/* $OpenBSD: auth-options.c,v 1.39 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: auth-options.c,v 1.40 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <netdb.h>
#include <pwd.h>
#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "match.h"
#include "log.h"
#include "canohost.h"
+#include "buffer.h"
#include "channels.h"
#include "auth-options.h"
#include "servconf.h"
#include "misc.h"
-#include "monitor_wrap.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+#include "monitor_wrap.h"
/* Flags set authorized_keys flags */
int no_port_forwarding_flag = 0;
-/* $OpenBSD: auth-options.h,v 1.15 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth-options.h,v 1.16 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef AUTH_OPTIONS_H
#define AUTH_OPTIONS_H
-#include <sys/types.h>
-
-#include <pwd.h>
-
/* Linked list of custom environment strings */
struct envstring {
struct envstring *next;
-/* $OpenBSD: auth-passwd.c,v 1.39 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth-passwd.c,v 1.40 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <pwd.h>
#include <stdio.h>
#include <string.h>
+#include <stdarg.h>
#include "packet.h"
#include "buffer.h"
#include "log.h"
#include "servconf.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "auth-options.h"
-/* $OpenBSD: auth-rh-rsa.c,v 1.41 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth-rh-rsa.c,v 1.42 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <sys/types.h>
#include <pwd.h>
+#include <stdarg.h>
#include "packet.h"
#include "uidswap.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
#include "key.h"
#include "hostfile.h"
#include "pathnames.h"
#include "auth.h"
#include "canohost.h"
-
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
/* import */
-/* $OpenBSD: auth-rhosts.c,v 1.40 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth-rhosts.c,v 1.41 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <pwd.h>
#include <stdio.h>
#include <string.h>
+#include <stdarg.h>
#include "packet.h"
+#include "buffer.h"
#include "uidswap.h"
#include "pathnames.h"
#include "log.h"
#include "servconf.h"
#include "canohost.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
/* import */
-/* $OpenBSD: auth-rsa.c,v 1.70 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth-rsa.c,v 1.71 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdio.h>
#include <string.h>
+#include "xmalloc.h"
#include "rsa.h"
#include "packet.h"
-#include "xmalloc.h"
#include "ssh1.h"
#include "uidswap.h"
#include "match.h"
+#include "buffer.h"
#include "auth-options.h"
#include "pathnames.h"
#include "log.h"
#include "servconf.h"
-#include "auth.h"
+#include "key.h"
#include "hostfile.h"
+#include "auth.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "ssh.h"
#include "misc.h"
-/* $OpenBSD: auth-skey.c,v 1.23 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth-skey.c,v 1.24 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
#ifdef SKEY
+#include <sys/types.h>
+
#include <skey.h>
#include "xmalloc.h"
-/* $OpenBSD: auth.c,v 1.74 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth.c,v 1.75 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "match.h"
#include "groupaccess.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "auth-options.h"
#include "canohost.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "uidswap.h"
#include "misc.h"
#include "bufaux.h"
#include "packet.h"
#include "loginrec.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
/* import */
-/* $OpenBSD: auth.h,v 1.56 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth.h,v 1.57 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
#ifndef AUTH_H
#define AUTH_H
-#include <sys/types.h>
-
-#include <signal.h>
-#include <pwd.h>
#include <signal.h>
-#include <stdio.h>
-#include "buffer.h"
#include <openssl/rsa.h>
#ifdef HAVE_LOGIN_CAP
#include <krb5.h>
#endif
-#include "key.h"
-#include "hostfile.h"
-
typedef struct Authctxt Authctxt;
typedef struct Authmethod Authmethod;
typedef struct KbdintDevice KbdintDevice;
-/* $OpenBSD: auth1.c,v 1.69 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth1.c,v 1.70 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <pwd.h>
#include "xmalloc.h"
#include "rsa.h"
#include "log.h"
#include "servconf.h"
#include "compat.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "channels.h"
#include "session.h"
#include "uidswap.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "buffer.h"
-/* $OpenBSD: auth2-chall.c,v 1.29 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth2-chall.c,v 1.30 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Per Allansson. All rights reserved.
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
+#include <sys/types.h>
+
#include <stdio.h>
#include <string.h>
+#include "xmalloc.h"
#include "ssh2.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "buffer.h"
#include "packet.h"
-#include "xmalloc.h"
#include "dispatch.h"
#include "log.h"
#include "servconf.h"
-/* $OpenBSD: auth2-gss.c,v 1.14 2006/03/25 22:22:42 djm Exp $ */
+/* $OpenBSD: auth2-gss.c,v 1.15 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
#include "includes.h"
-#ifdef GSSAPI
+#include <sys/types.h>
+#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "log.h"
#include "dispatch.h"
+#include "buffer.h"
#include "servconf.h"
#include "packet.h"
-#include "monitor_wrap.h"
-
#include "ssh-gss.h"
+#include "monitor_wrap.h"
extern ServerOptions options;
userauth_gssapi,
&options.gss_authentication
};
-
-#endif /* GSSAPI */
-/* $OpenBSD: auth2-hostbased.c,v 1.10 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.11 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include <pwd.h>
#include <string.h>
+#include <stdarg.h>
-#include "ssh2.h"
#include "xmalloc.h"
+#include "ssh2.h"
#include "packet.h"
#include "buffer.h"
#include "log.h"
#include "servconf.h"
#include "compat.h"
-#include "bufaux.h"
-#include "auth.h"
#include "key.h"
+#include "hostfile.h"
+#include "auth.h"
#include "canohost.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "pathnames.h"
-/* $OpenBSD: auth2-kbdint.c,v 1.4 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth2-kbdint.c,v 1.5 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
+#include "xmalloc.h"
#include "packet.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
-#include "xmalloc.h"
/* import */
extern ServerOptions options;
-/* $OpenBSD: auth2-none.c,v 1.11 2006/07/09 15:15:10 stevesk Exp $ */
+/* $OpenBSD: auth2-none.c,v 1.12 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include <fcntl.h>
-#include "auth.h"
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
+#include "auth.h"
#include "packet.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
#include "atomicio.h"
#include "compat.h"
#include "ssh2.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
/* import */
-/* $OpenBSD: auth2-passwd.c,v 1.8 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: auth2-passwd.c,v 1.9 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <string.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "packet.h"
#include "log.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
+#include "buffer.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "servconf.h"
-/* $OpenBSD: auth2-pubkey.c,v 1.14 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: auth2-pubkey.c,v 1.15 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include <pwd.h>
#include <stdio.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "packet.h"
#include "buffer.h"
#include "log.h"
#include "servconf.h"
#include "compat.h"
-#include "bufaux.h"
-#include "auth.h"
#include "key.h"
+#include "hostfile.h"
+#include "auth.h"
#include "pathnames.h"
#include "uidswap.h"
#include "auth-options.h"
#include "canohost.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "misc.h"
-/* $OpenBSD: auth2.c,v 1.112 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: auth2.c,v 1.113 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include <sys/types.h>
#include <pwd.h>
+#include <stdarg.h>
#include <string.h>
-#include "ssh2.h"
#include "xmalloc.h"
+#include "ssh2.h"
#include "packet.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
#include "compat.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "dispatch.h"
#include "pathnames.h"
-#include "monitor_wrap.h"
#include "buffer.h"
#ifdef GSSAPI
#include "ssh-gss.h"
#endif
+#include "monitor_wrap.h"
/* import */
extern ServerOptions options;
-/* $OpenBSD: authfd.c,v 1.79 2006/07/26 13:57:17 stevesk Exp $ */
+/* $OpenBSD: authfd.c,v 1.80 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <openssl/evp.h>
+#include <openssl/crypto.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <signal.h>
#include <string.h>
#include <unistd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "rsa.h"
#include "buffer.h"
-#include "bufaux.h"
-#include "xmalloc.h"
#include "key.h"
#include "authfd.h"
#include "cipher.h"
-/* $OpenBSD: authfd.h,v 1.35 2006/03/25 22:22:42 djm Exp $ */
+/* $OpenBSD: authfd.h,v 1.36 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef AUTHFD_H
#define AUTHFD_H
-#include "buffer.h"
-
/* Messages for the authentication agent connection. */
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
-/* $OpenBSD: authfile.c,v 1.75 2006/08/01 23:36:11 stevesk Exp $ */
+/* $OpenBSD: authfile.c,v 1.76 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
+#include <sys/uio.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <string.h>
#include <unistd.h>
-#include "cipher.h"
#include "xmalloc.h"
+#include "cipher.h"
#include "buffer.h"
-#include "bufaux.h"
#include "key.h"
#include "ssh.h"
#include "log.h"
-/* $OpenBSD: bufaux.c,v 1.43 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: bufaux.c,v 1.44 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/bn.h>
#include <string.h>
+#include <stdarg.h>
-#include "bufaux.h"
#include "xmalloc.h"
+#include "buffer.h"
#include "log.h"
#include "misc.h"
-/* $OpenBSD: bufbn.c,v 1.2 2006/07/22 20:48:22 stevesk Exp $*/
+/* $OpenBSD: bufbn.c,v 1.3 2006/08/03 03:34:41 deraadt Exp $*/
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/bn.h>
#include <string.h>
+#include <stdarg.h>
-#include "bufaux.h"
#include "xmalloc.h"
+#include "buffer.h"
#include "log.h"
#include "misc.h"
-/* $OpenBSD: buffer.c,v 1.30 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: buffer.c,v 1.31 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdio.h>
#include <string.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "buffer.h"
-/* $OpenBSD: buffer.h,v 1.15 2006/04/16 00:48:52 djm Exp $ */
+/* $OpenBSD: buffer.h,v 1.16 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
int buffer_consume_ret(Buffer *, u_int);
int buffer_consume_end_ret(Buffer *, u_int);
+#include <openssl/bn.h>
+
+void buffer_put_bignum(Buffer *, const BIGNUM *);
+void buffer_put_bignum2(Buffer *, const BIGNUM *);
+void buffer_get_bignum(Buffer *, BIGNUM *);
+void buffer_get_bignum2(Buffer *, BIGNUM *);
+
+u_short buffer_get_short(Buffer *);
+void buffer_put_short(Buffer *, u_short);
+
+u_int buffer_get_int(Buffer *);
+void buffer_put_int(Buffer *, u_int);
+
+u_int64_t buffer_get_int64(Buffer *);
+void buffer_put_int64(Buffer *, u_int64_t);
+
+int buffer_get_char(Buffer *);
+void buffer_put_char(Buffer *, int);
+
+void *buffer_get_string(Buffer *, u_int *);
+void buffer_put_string(Buffer *, const void *, u_int);
+void buffer_put_cstring(Buffer *, const char *);
+
+#define buffer_skip_string(b) \
+ do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while (0)
+
+int buffer_put_bignum_ret(Buffer *, const BIGNUM *);
+int buffer_get_bignum_ret(Buffer *, BIGNUM *);
+int buffer_put_bignum2_ret(Buffer *, const BIGNUM *);
+int buffer_get_bignum2_ret(Buffer *, BIGNUM *);
+int buffer_get_short_ret(u_short *, Buffer *);
+int buffer_get_int_ret(u_int *, Buffer *);
+int buffer_get_int64_ret(u_int64_t *, Buffer *);
+void *buffer_get_string_ret(Buffer *, u_int *);
+int buffer_get_char_ret(char *, Buffer *);
+
#endif /* BUFFER_H */
-/* $OpenBSD: canohost.c,v 1.60 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: canohost.c,v 1.61 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
-#include "packet.h"
#include "xmalloc.h"
+#include "packet.h"
#include "log.h"
#include "canohost.h"
-/* $OpenBSD: channels.c,v 1.264 2006/08/01 23:36:11 stevesk Exp $ */
+/* $OpenBSD: channels.c,v 1.265 2006/08/03 03:34:41 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
-#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <sys/un.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_TIME_H
#include <string.h>
#include <termios.h>
#include <unistd.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
#include "packet.h"
-#include "xmalloc.h"
#include "log.h"
#include "misc.h"
+#include "buffer.h"
#include "channels.h"
#include "compat.h"
#include "canohost.h"
#include "key.h"
#include "authfd.h"
#include "pathnames.h"
-#include "bufaux.h"
/* -- channel core */
-/* $OpenBSD: channels.h,v 1.87 2006/07/21 12:43:36 dtucker Exp $ */
+/* $OpenBSD: channels.h,v 1.88 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef CHANNEL_H
#define CHANNEL_H
-#include "buffer.h"
-
/* Definitions for channel types. */
#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */
#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */
-/* $OpenBSD: cipher-3des1.c,v 1.5 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: cipher-3des1.c,v 1.6 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/evp.h>
#include <string.h>
-/* $OpenBSD: cipher-bf1.c,v 1.4 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: cipher-bf1.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/evp.h>
#include <string.h>
-/* $OpenBSD: cipher-ctr.c,v 1.9 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: cipher-ctr.c,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
*
*/
#include "includes.h"
+#include <sys/types.h>
+
#include <string.h>
#include <openssl/evp.h>
-#include "log.h"
#include "xmalloc.h"
+#include "log.h"
/* compatibility with old or broken OpenSSL versions */
#include "openbsd-compat/openssl-compat.h"
-/* $OpenBSD: cipher.c,v 1.80 2006/07/22 20:48:22 stevesk Exp $ */
+/* $OpenBSD: cipher.c,v 1.81 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/md5.h>
#include <string.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "log.h"
-/* $OpenBSD: cleanup.c,v 1.4 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: cleanup.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
*
#include "config.h"
+#include <sys/types.h>
+
#include <unistd.h>
+#include <stdarg.h>
#include "log.h"
-/* $OpenBSD: clientloop.c,v 1.174 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: clientloop.c,v 1.175 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdlib.h>
#include <string.h>
#include <termios.h>
+#include <pwd.h>
#include <unistd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "packet.h"
#include "buffer.h"
#include "compat.h"
#include "channels.h"
#include "dispatch.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "readconf.h"
-/* $OpenBSD: compat.c,v 1.75 2006/07/26 13:57:17 stevesk Exp $ */
+/* $OpenBSD: compat.c,v 1.76 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "buffer.h"
#include "packet.h"
-#include "xmalloc.h"
#include "compat.h"
#include "log.h"
#include "match.h"
-/* $OpenBSD: compress.c,v 1.23 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: compress.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
+#include <stdarg.h>
+
#include "log.h"
#include "buffer.h"
#include "zlib.h"
-/* $OpenBSD: deattack.c,v 1.28 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: deattack.c,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Cryptographic attack detector for ssh - source code
*
#include "includes.h"
+#include <sys/types.h>
+
#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "deattack.h"
#include "log.h"
#include "crc32.h"
-#include "xmalloc.h"
#include "misc.h"
/* SSH Constants */
-/* $OpenBSD: dh.c,v 1.41 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: dh.c,v 1.42 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
*
-/* $OpenBSD: dispatch.c,v 1.20 2006/07/23 01:11:05 stevesk Exp $ */
+/* $OpenBSD: dispatch.c,v 1.21 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
+#include <sys/types.h>
+
#include <signal.h>
+#include <stdarg.h>
#include "ssh1.h"
#include "ssh2.h"
-/* $OpenBSD: dns.c,v 1.22 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: dns.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Wesley Griffin. All rights reserved.
-/* $OpenBSD: dns.h,v 1.9 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: dns.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Wesley Griffin. All rights reserved.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "includes.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stdio.h>
-
#ifndef DNS_H
#define DNS_H
-/* $OpenBSD: fatal.c,v 1.6 2006/07/10 16:37:36 stevesk Exp $ */
+/* $OpenBSD: fatal.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <stdarg.h>
#include "log.h"
-/* $OpenBSD: groupaccess.c,v 1.11 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: groupaccess.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Kevin Steves. All rights reserved.
*
#include <grp.h>
#include <unistd.h>
+#include <stdarg.h>
-#include "groupaccess.h"
#include "xmalloc.h"
+#include "groupaccess.h"
#include "match.h"
#include "log.h"
-/* $OpenBSD: groupaccess.h,v 1.6 2006/07/02 22:45:59 stevesk Exp $ */
+/* $OpenBSD: groupaccess.h,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Kevin Steves. All rights reserved.
#ifndef GROUPACCESS_H
#define GROUPACCESS_H
-#include <sys/types.h>
-
int ga_init(const char *, gid_t);
int ga_match(char * const *, int);
void ga_free(void);
-/* $OpenBSD: gss-genr.c,v 1.12 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: gss-genr.c,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
#ifdef GSSAPI
+#include <sys/types.h>
#include <sys/param.h>
+#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include "xmalloc.h"
-#include "bufaux.h"
+#include "buffer.h"
#include "log.h"
#include "ssh2.h"
-/* $OpenBSD: gss-serv-krb5.c,v 1.6 2006/07/02 18:36:47 stevesk Exp $ */
+/* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
#ifdef GSSAPI
#ifdef KRB5
+#include <sys/types.h>
+
#include <string.h>
-#include "auth.h"
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
+#include "auth.h"
#include "log.h"
#include "servconf.h"
+#include "buffer.h"
#include "ssh-gss.h"
extern ServerOptions options;
-/* $OpenBSD: gss-serv.c,v 1.19 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: gss-serv.c,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
#ifdef GSSAPI
+#include <sys/types.h>
+
#include <string.h>
#include <unistd.h>
-#include "bufaux.h"
+#include "xmalloc.h"
+#include "buffer.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "log.h"
#include "channels.h"
#include "session.h"
-#include "xmalloc.h"
#include "misc.h"
#include "ssh-gss.h"
-/* $OpenBSD: hostfile.c,v 1.44 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: hostfile.c,v 1.45 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdlib.h>
#include <string.h>
+#include "xmalloc.h"
#include "match.h"
#include "key.h"
#include "hostfile.h"
#include "log.h"
-#include "xmalloc.h"
static int
extract_salt(const char *s, u_int l, char *salt, size_t salt_len)
#ifdef HAVE_LIMITS_H
# include <limits.h> /* For PATH_MAX */
#endif
-#ifdef HAVE_GETOPT_H
-# include <getopt.h>
-#endif
#ifdef HAVE_BSTRING_H
# include <bstring.h>
#endif
-/* $OpenBSD: kex.c,v 1.75 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: kex.c,v 1.76 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
#include <sys/param.h>
-#include <openssl/crypto.h>
-
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "ssh2.h"
+#include <openssl/crypto.h>
+
#include "xmalloc.h"
+#include "ssh2.h"
#include "buffer.h"
-#include "bufaux.h"
#include "packet.h"
#include "compat.h"
#include "cipher.h"
-#include "kex.h"
#include "key.h"
+#include "kex.h"
#include "log.h"
#include "mac.h"
#include "match.h"
-/* $OpenBSD: kex.h,v 1.43 2006/07/23 01:11:05 stevesk Exp $ */
+/* $OpenBSD: kex.h,v 1.44 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
#include <signal.h>
#include <openssl/evp.h>
-#include <signal.h>
-
-#include "buffer.h"
-#include "cipher.h"
-#include "key.h"
-
#define KEX_DH1 "diffie-hellman-group1-sha1"
#define KEX_DH14 "diffie-hellman-group14-sha1"
#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
-/* $OpenBSD: kexdh.c,v 1.22 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: kexdh.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
+#include <signal.h>
+
#include <openssl/evp.h>
#include "buffer.h"
-#include "bufaux.h"
#include "ssh2.h"
+#include "key.h"
+#include "cipher.h"
#include "kex.h"
void
-/* $OpenBSD: kexdhc.c,v 1.8 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: kexdhc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <stdio.h>
#include <string.h>
+#include <signal.h>
#include "xmalloc.h"
+#include "buffer.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "packet.h"
-/* $OpenBSD: kexdhs.c,v 1.6 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: kexdhs.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
#include <string.h>
+#include <signal.h>
#include "xmalloc.h"
+#include "buffer.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "packet.h"
#include "dh.h"
#include "ssh2.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
void
-/* $OpenBSD: kexgex.c,v 1.26 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: kexgex.c,v 1.27 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/evp.h>
+#include <signal.h>
#include "buffer.h"
-#include "bufaux.h"
+#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "ssh2.h"
-/* $OpenBSD: kexgexc.c,v 1.8 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#include "includes.h"
+#include <sys/types.h>
+
#include <stdio.h>
#include <string.h>
+#include <signal.h>
#include "xmalloc.h"
+#include "buffer.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "packet.h"
-/* $OpenBSD: kexgexs.c,v 1.7 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: kexgexs.c,v 1.8 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#include <stdio.h>
#include <string.h>
+#include <signal.h>
#include "xmalloc.h"
+#include "buffer.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "log.h"
#include "packet.h"
#include "dh.h"
#include "ssh2.h"
#include "compat.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
void
-/* $OpenBSD: key.c,v 1.66 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: key.c,v 1.67 2006/08/03 03:34:42 deraadt Exp $ */
/*
* read_bignum():
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/evp.h>
#include <stdio.h>
#include "rsa.h"
#include "uuencode.h"
#include "buffer.h"
-#include "bufaux.h"
#include "log.h"
Key *
-/* $OpenBSD: key.h,v 1.25 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: key.h,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
#include <openssl/rsa.h>
#include <openssl/dsa.h>
-#include <stdio.h>
-
typedef struct Key Key;
enum types {
KEY_RSA1,
-/* $OpenBSD: log.c,v 1.37 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: log.c,v 1.38 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
# include <vis.h>
#endif
-#include "log.h"
#include "xmalloc.h"
+#include "log.h"
static LogLevel log_level = SYSLOG_LEVEL_INFO;
static int log_on_stderr = 1;
-/* $OpenBSD: log.h,v 1.13 2006/07/10 16:37:36 stevesk Exp $ */
+/* $OpenBSD: log.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef SSH_LOG_H
#define SSH_LOG_H
-#include "includes.h"
-
-#include <stdarg.h>
-
-#include <syslog.h> /* Needed for LOG_AUTHPRIV (if present) */
-
/* Supported syslog facilities and levels. */
typedef enum {
SYSLOG_FACILITY_DAEMON,
#include <string.h>
#include <unistd.h>
-#include "ssh.h"
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
+#include "ssh.h"
#include "loginrec.h"
#include "log.h"
#include "atomicio.h"
#include "includes.h"
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-
/**
** you should use the login_* calls to work around platform dependencies
**/
-/* $OpenBSD: mac.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: mac.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/hmac.h>
#include <string.h>
+#include <signal.h>
#include "xmalloc.h"
#include "log.h"
#include "cipher.h"
+#include "buffer.h"
+#include "key.h"
#include "kex.h"
#include "mac.h"
#include "misc.h"
-/* $OpenBSD: match.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: match.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <ctype.h>
#include <string.h>
-#include "match.h"
#include "xmalloc.h"
+#include "match.h"
/*
* Returns true if the given string matches the pattern (which may contain ?
-/* $OpenBSD: md-sha256.c,v 1.4 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: md-sha256.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2005 Damien Miller <djm@openbsd.org>
*
/* EVP wrapper for SHA256 */
#include "includes.h"
+
+#include <sys/types.h>
#include <openssl/opensslv.h>
#if !defined(HAVE_EVP_SHA256) && (OPENSSL_VERSION_NUMBER >= 0x00907000L)
-/* $OpenBSD: misc.c,v 1.63 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: misc.c,v 1.64 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved.
#include "includes.h"
-#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <net/if.h>
#endif
+#include "xmalloc.h"
#include "misc.h"
#include "log.h"
-#include "xmalloc.h"
#include "ssh.h"
/* remove newline at end of string */
-/* $OpenBSD: misc.h,v 1.34 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: misc.h,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef _MISC_H
#define _MISC_H
-#include <sys/types.h>
-
-#include <pwd.h>
-#include <stdio.h>
-
/* misc.c */
char *chop(char *);
-/* $OpenBSD: moduli.c,v 1.17 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: moduli.c,v 1.18 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include <time.h>
#include "xmalloc.h"
-/* $OpenBSD: monitor.c,v 1.84 2006/07/26 13:57:17 stevesk Exp $ */
+/* $OpenBSD: monitor.c,v 1.85 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
+#include "openbsd-compat/sys-tree.h"
#include <sys/wait.h>
#include <errno.h>
#include <openssl/dh.h>
+#include "xmalloc.h"
#include "ssh.h"
+#include "key.h"
+#include "buffer.h"
+#include "hostfile.h"
#include "auth.h"
+#include "cipher.h"
#include "kex.h"
#include "dh.h"
#ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */
#include "servconf.h"
#include "monitor.h"
#include "monitor_mm.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "monitor_fdpass.h"
-#include "xmalloc.h"
#include "misc.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "compat.h"
#include "ssh2.h"
#ifdef GSSAPI
-#include "ssh-gss.h"
static Gssctxt *gsscontext = NULL;
#endif
-/* $OpenBSD: monitor_fdpass.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
#include <errno.h>
#include <string.h>
+#include <stdarg.h>
#include "log.h"
#include "monitor_fdpass.h"
-/* $OpenBSD: monitor_mm.c,v 1.14 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: monitor_mm.c,v 1.15 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
#include "includes.h"
+#include <sys/types.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <sys/param.h>
+#include "openbsd-compat/sys-tree.h"
#include <errno.h>
+#include <stdarg.h>
#include <string.h>
-#include "ssh.h"
#include "xmalloc.h"
+#include "ssh.h"
#include "log.h"
#include "monitor_mm.h"
-/* $OpenBSD: monitor_mm.h,v 1.3 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: monitor_mm.h,v 1.4 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
#ifndef _MM_H_
#define _MM_H_
-#include "openbsd-compat/sys-tree.h"
struct mm_share {
RB_ENTRY(mm_share) next;
-/* $OpenBSD: monitor_wrap.c,v 1.49 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.50 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
#include <sys/types.h>
-#include <openssl/bn.h>
-#include <openssl/dh.h>
-
#include <errno.h>
#include <pwd.h>
+#include <signal.h>
#include <stdio.h>
#include <string.h>
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+
+#include "xmalloc.h"
#include "ssh.h"
#include "dh.h"
+#include "buffer.h"
+#include "key.h"
+#include "cipher.h"
#include "kex.h"
+#include "hostfile.h"
#include "auth.h"
#include "auth-options.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "packet.h"
#include "mac.h"
#include "log.h"
#include "zlib.h"
#endif
#include "monitor.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
-#include "xmalloc.h"
#include "atomicio.h"
#include "monitor_fdpass.h"
#include "misc.h"
#include "servconf.h"
-#include "auth.h"
#include "channels.h"
#include "session.h"
-#ifdef GSSAPI
-#include "ssh-gss.h"
-#endif
-
/* Imports */
extern int compat20;
extern Newkeys *newkeys[];
-/* $OpenBSD: monitor_wrap.h,v 1.19 2006/07/14 01:15:28 stevesk Exp $ */
+/* $OpenBSD: monitor_wrap.h,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
#ifndef _MM_WRAP_H_
#define _MM_WRAP_H_
-#include <sys/types.h>
-
-#include <pwd.h>
-
-#include "key.h"
-#include "buffer.h"
-
extern int use_privsep;
#define PRIVSEP(x) (use_privsep ? mm_##x : x)
BIGNUM *mm_auth_rsa_generate_challenge(Key *);
#ifdef GSSAPI
-#include "ssh-gss.h"
OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID);
OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *,
gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *);
-/* $OpenBSD: msg.c,v 1.14 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: msg.c,v 1.15 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
#include <sys/types.h>
+#include <sys/uio.h>
#include <errno.h>
+#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <stdarg.h>
#include "buffer.h"
#include "log.h"
-/* $OpenBSD: nchan.c,v 1.56 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: nchan.c,v 1.57 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
*
#include <errno.h>
#include <string.h>
+#include <stdarg.h>
#include "ssh1.h"
#include "ssh2.h"
*
*/
#include "includes.h"
+
+#include "xmalloc.h"
+#include "buffer.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
#include "ssh.h"
#include "log.h"
-#include "xmalloc.h"
-#include "buffer.h"
#ifdef _AIX
#ifndef _PORT_TUN_H
#define _PORT_TUN_H
-#include "channels.h"
-
#if defined(SSH_TUN_LINUX) || defined(SSH_TUN_FREEBSD)
# define CUSTOM_SYS_TUN_OPEN
int sys_tun_open(int, int);
-/* $OpenBSD: packet.c,v 1.141 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: packet.c,v 1.142 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <signal.h>
#include "xmalloc.h"
#include "buffer.h"
#include "packet.h"
-#include "bufaux.h"
#include "crc32.h"
-
#include "compress.h"
#include "deattack.h"
#include "channels.h"
-
#include "compat.h"
#include "ssh1.h"
#include "ssh2.h"
-
#include "cipher.h"
+#include "key.h"
#include "kex.h"
#include "mac.h"
#include "log.h"
-/* $OpenBSD: progressmeter.c,v 1.36 2006/08/01 23:36:12 stevesk Exp $ */
+/* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Nils Nordman. All rights reserved.
*
#include <sys/types.h>
#include <sys/ioctl.h>
+#include <sys/uio.h>
#include <errno.h>
#include <signal.h>
-/* $OpenBSD: readconf.c,v 1.158 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: readconf.c,v 1.159 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <ctype.h>
#include <errno.h>
#include <netdb.h>
+#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include "ssh.h"
#include "xmalloc.h"
+#include "ssh.h"
#include "compat.h"
#include "cipher.h"
#include "pathnames.h"
#include "log.h"
+#include "key.h"
#include "readconf.h"
#include "match.h"
#include "misc.h"
+#include "buffer.h"
#include "kex.h"
#include "mac.h"
-/* $OpenBSD: readconf.h,v 1.70 2006/07/11 18:50:48 markus Exp $ */
+/* $OpenBSD: readconf.h,v 1.71 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef READCONF_H
#define READCONF_H
-#include "key.h"
-
/* Data structure for representing a forwarding request. */
typedef struct {
-/* $OpenBSD: readpass.c,v 1.46 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: readpass.c,v 1.47 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
-/* $OpenBSD: rsa.c,v 1.27 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: rsa.c,v 1.28 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <string.h>
+#include "xmalloc.h"
#include "rsa.h"
#include "log.h"
-#include "xmalloc.h"
void
rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
-/* $OpenBSD: scard.c,v 1.34 2006/08/01 23:36:12 stevesk Exp $ */
+/* $OpenBSD: scard.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "includes.h"
#if defined(SMARTCARD) && defined(USE_SECTOK)
-#include <openssl/evp.h>
+#include <sys/types.h>
#include <sectok.h>
#include <string.h>
+#include <openssl/evp.h>
+
+#include "xmalloc.h"
#include "key.h"
#include "log.h"
-#include "xmalloc.h"
#include "misc.h"
#include "scard.h"
-/* $OpenBSD: scard.h,v 1.13 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: scard.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#ifndef SCARD_H
#define SCARD_H
-#include "key.h"
-
#define SCARD_ERROR_FAIL -1
#define SCARD_ERROR_NOCARD -2
#define SCARD_ERROR_APPLET -3
-/* $OpenBSD: scp.c,v 1.154 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: scp.c,v 1.155 2006/08/03 03:34:42 deraadt Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
# include <sys/time.h>
#endif
#include <sys/wait.h>
+#include <sys/uio.h>
#include <ctype.h>
#include <dirent.h>
-/* $OpenBSD: servconf.c,v 1.163 2006/08/01 23:36:12 stevesk Exp $ */
+/* $OpenBSD: servconf.c,v 1.164 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <signal.h>
#include <unistd.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
-#include "xmalloc.h"
#include "compat.h"
#include "pathnames.h"
#include "misc.h"
#include "cipher.h"
+#include "key.h"
#include "kex.h"
#include "mac.h"
#include "match.h"
-/* $OpenBSD: servconf.h,v 1.77 2006/07/21 12:43:36 dtucker Exp $ */
+/* $OpenBSD: servconf.h,v 1.78 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#ifndef SERVCONF_H
#define SERVCONF_H
-#include "buffer.h"
-
#define MAX_PORTS 256 /* Max # ports. */
#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */
-/* $OpenBSD: serverloop.c,v 1.143 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: serverloop.c,v 1.144 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <string.h>
#include <termios.h>
#include <unistd.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "packet.h"
#include "compat.h"
#include "ssh1.h"
#include "ssh2.h"
+#include "key.h"
+#include "cipher.h"
+#include "kex.h"
+#include "hostfile.h"
#include "auth.h"
#include "session.h"
#include "dispatch.h"
#include "auth-options.h"
#include "serverloop.h"
#include "misc.h"
-#include "kex.h"
extern ServerOptions options;
-/* $OpenBSD: session.c,v 1.215 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: session.c,v 1.216 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
#include <string.h>
#include <unistd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "sshpty.h"
#include "packet.h"
#include "buffer.h"
#include "uidswap.h"
#include "compat.h"
#include "channels.h"
-#include "bufaux.h"
+#include "key.h"
+#include "cipher.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+#include "hostfile.h"
#include "auth.h"
#include "auth-options.h"
#include "pathnames.h"
#include <kafs.h>
#endif
-#ifdef GSSAPI
-#include "ssh-gss.h"
-#endif
-
/* func */
Session *session_new(void);
-/* $OpenBSD: session.h,v 1.28 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: session.h,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
#ifndef SESSION_H
#define SESSION_H
-#include <sys/types.h>
-
-#include <pwd.h>
-
#define TTYSZ 64
typedef struct Session Session;
struct Session {
-/* $OpenBSD: sftp-client.c,v 1.73 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.74 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
#include <sys/types.h>
#include <sys/param.h>
+#include "openbsd-compat/sys-queue.h"
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
+#include <sys/uio.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include "openbsd-compat/sys-queue.h"
-
-#include "buffer.h"
-#include "bufaux.h"
#include "xmalloc.h"
+#include "buffer.h"
#include "log.h"
#include "atomicio.h"
#include "progressmeter.h"
iov[0].iov_len = sizeof(mlen);
iov[1].iov_base = buffer_ptr(m);
iov[1].iov_len = buffer_len(m);
-
+
if (atomiciov(writev, fd, iov, 2) != buffer_len(m) + sizeof(mlen))
fatal("Couldn't send packet: %s", strerror(errno));
-/* $OpenBSD: sftp-common.c,v 1.19 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sftp-common.c,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Damien Miller. All rights reserved.
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "buffer.h"
-#include "bufaux.h"
#include "log.h"
-#include "xmalloc.h"
#include "sftp.h"
#include "sftp-common.h"
-/* $OpenBSD: sftp-common.h,v 1.9 2006/07/10 16:01:57 stevesk Exp $ */
+/* $OpenBSD: sftp-common.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "buffer.h"
-
/* Maximum packet that we are willing to send/accept */
#define SFTP_MAX_MSG_LENGTH (256 * 1024)
-/* $OpenBSD: sftp-glob.c,v 1.21 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: sftp-glob.c,v 1.22 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
#include <string.h>
#include "xmalloc.h"
-
#include "sftp.h"
+#include "buffer.h"
#include "sftp-common.h"
#include "sftp-client.h"
-/* $OpenBSD: sftp-server.c,v 1.69 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.70 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
#include "includes.h"
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <pwd.h>
#include <time.h>
#include <unistd.h>
+#include <stdarg.h>
+#include "xmalloc.h"
#include "buffer.h"
-#include "bufaux.h"
#include "log.h"
-#include "xmalloc.h"
#include "misc.h"
#include "uidswap.h"
#define PAPPEND(str) { \
if (*ret != '\0') \
strlcat(ret, ",", sizeof(ret)); \
- strlcat(ret, str, sizeof(ret)); \
+ strlcat(ret, str, sizeof(ret)); \
}
if (pflags & SSH2_FXF_READ)
case 'c':
/*
* Ignore all arguments if we are invoked as a
- * shell using "sftp-server -c command"
+ * shell using "sftp-server -c command"
*/
skipargs = 1;
break;
-/* $OpenBSD: sftp.c,v 1.90 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sftp.c,v 1.91 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
#include "includes.h"
#include <sys/types.h>
+#include <sys/ioctl.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <stdarg.h>
#include "xmalloc.h"
#include "log.h"
#include "misc.h"
#include "sftp.h"
+#include "buffer.h"
#include "sftp-common.h"
#include "sftp-client.h"
-/* $OpenBSD: ssh-add.c,v 1.88 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.89 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <string.h>
#include <unistd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "rsa.h"
#include "log.h"
-#include "xmalloc.h"
#include "key.h"
+#include "buffer.h"
#include "authfd.h"
#include "authfile.h"
#include "pathnames.h"
-/* $OpenBSD: ssh-agent.c,v 1.150 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.151 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <string.h>
#include <unistd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "rsa.h"
#include "buffer.h"
-#include "bufaux.h"
-#include "xmalloc.h"
#include "key.h"
#include "authfd.h"
#include "compat.h"
-/* $OpenBSD: ssh-dss.c,v 1.22 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: ssh-dss.c,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/bn.h>
#include <openssl/evp.h>
#include "xmalloc.h"
#include "buffer.h"
-#include "bufaux.h"
#include "compat.h"
#include "log.h"
#include "key.h"
-/* $OpenBSD: ssh-gss.h,v 1.6 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: ssh-gss.h,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
*
#ifdef GSSAPI
-#include "buffer.h"
-
#ifdef HAVE_GSSAPI_H
#include <gssapi.h>
#elif defined(HAVE_GSSAPI_GSSAPI_H)
-/* $OpenBSD: ssh-keygen.c,v 1.153 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.154 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "authfile.h"
#include "uuencode.h"
#include "buffer.h"
-#include "bufaux.h"
#include "pathnames.h"
#include "log.h"
#include "misc.h"
-/* $OpenBSD: ssh-keyscan.c,v 1.72 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.73 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <signal.h>
#include <string.h>
#include <unistd.h>
#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
+#include "buffer.h"
#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "compat.h"
#include "myproposal.h"
#include "packet.h"
#include "dispatch.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "log.h"
#include "atomicio.h"
#include "misc.h"
-/* $OpenBSD: ssh-keysign.c,v 1.28 2006/07/26 13:57:17 stevesk Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.29 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "includes.h"
#include <fcntl.h>
#include <openssl/rand.h>
#include <openssl/rsa.h>
+#include "xmalloc.h"
#include "log.h"
#include "key.h"
#include "ssh.h"
#include "ssh2.h"
#include "misc.h"
-#include "xmalloc.h"
#include "buffer.h"
-#include "bufaux.h"
#include "authfile.h"
#include "msg.h"
#include "canohost.h"
-/* $OpenBSD: ssh-rsa.c,v 1.38 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: ssh-rsa.c,v 1.39 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
*
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
#include "includes.h"
+#include <sys/types.h>
+
#include <openssl/evp.h>
#include <openssl/err.h>
#include "xmalloc.h"
#include "log.h"
#include "buffer.h"
-#include "bufaux.h"
#include "key.h"
#include "compat.h"
#include "ssh.h"
-/* $OpenBSD: ssh.c,v 1.292 2006/08/01 23:36:12 stevesk Exp $ */
+/* $OpenBSD: ssh.c,v 1.293 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <openssl/evp.h>
#include <openssl/err.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
#include "compat.h"
#include "cipher.h"
-#include "xmalloc.h"
#include "packet.h"
#include "buffer.h"
-#include "bufaux.h"
#include "channels.h"
#include "key.h"
#include "authfd.h"
cp = tilde_expand_filename(options.identity_files[i],
original_real_uid);
filename = percent_expand(cp, "d", pw->pw_dir,
- "u", pw->pw_name, "l", thishost, "h", host,
+ "u", pw->pw_name, "l", thishost, "h", host,
"r", options.user, (char *)NULL);
xfree(cp);
public = key_load_public(filename, NULL);
-/* $OpenBSD: ssh.h,v 1.77 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: ssh.h,v 1.78 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* called by a name other than "ssh" or "Secure Shell".
*/
-#ifndef SSH_H
-#define SSH_H
-
-#include <netinet/in.h> /* For struct sockaddr_in */
-#include <pwd.h> /* For struct pw */
-#include <stdarg.h> /* For va_list */
-#include <syslog.h> /* For LOG_AUTH and friends */
-#include <sys/socket.h> /* For struct sockaddr_storage */
-#ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-
/* Cipher used for encrypting authentication files. */
#define SSH_AUTHFILE_CIPHER SSH_CIPHER_3DES
/* Listen backlog for sshd, ssh-agent and forwarding sockets */
#define SSH_LISTEN_BACKLOG 128
-
-#endif /* SSH_H */
-/* $OpenBSD: sshconnect.c,v 1.198 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.199 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <string.h>
#include <unistd.h>
-#include "ssh.h"
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
+#include "ssh.h"
#include "rsa.h"
#include "buffer.h"
#include "packet.h"
-/* $OpenBSD: sshconnect.h,v 1.22 2006/07/08 21:47:12 stevesk Exp $ */
+/* $OpenBSD: sshconnect.h,v 1.23 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SSHCONNECT_H
-#define SSHCONNECT_H
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <pwd.h>
typedef struct Sensitive Sensitive;
struct Sensitive {
strerror(errno)); \
errno = save_errno; \
} while (0)
-
-#endif
-/* $OpenBSD: sshconnect1.c,v 1.68 2006/08/01 23:22:47 stevesk Exp $ */
+/* $OpenBSD: sshconnect1.c,v 1.69 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+
#include <openssl/bn.h>
#include <openssl/md5.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <signal.h>
+#include <pwd.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
-#include "xmalloc.h"
#include "rsa.h"
#include "buffer.h"
#include "packet.h"
+#include "key.h"
+#include "cipher.h"
#include "kex.h"
#include "uidswap.h"
#include "log.h"
#include "readconf.h"
-#include "key.h"
#include "authfd.h"
#include "sshconnect.h"
#include "authfile.h"
#include "misc.h"
-#include "cipher.h"
#include "canohost.h"
+#include "hostfile.h"
#include "auth.h"
/* Session id for the current session. */
-/* $OpenBSD: sshconnect2.c,v 1.159 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.160 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <errno.h>
+#include <pwd.h>
+#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "openbsd-compat/sys-queue.h"
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "buffer.h"
#include "packet.h"
#include "compat.h"
-#include "bufaux.h"
#include "cipher.h"
+#include "key.h"
#include "kex.h"
#include "myproposal.h"
#include "sshconnect.h"
-/* $OpenBSD: sshd.c,v 1.342 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: sshd.c,v 1.343 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#include <sys/ioctl.h>
-#include <sys/socket.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
+#include "openbsd-compat/sys-tree.h"
#include <sys/wait.h>
#include <errno.h>
#include <prot.h>
#endif
+#include "xmalloc.h"
#include "ssh.h"
#include "ssh1.h"
#include "ssh2.h"
-#include "xmalloc.h"
#include "rsa.h"
#include "sshpty.h"
#include "packet.h"
#include "log.h"
+#include "buffer.h"
#include "servconf.h"
#include "uidswap.h"
#include "compat.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "cipher.h"
-#include "kex.h"
#include "key.h"
+#include "kex.h"
#include "dh.h"
#include "myproposal.h"
#include "authfile.h"
#include "pathnames.h"
#include "atomicio.h"
#include "canohost.h"
+#include "hostfile.h"
#include "auth.h"
#include "misc.h"
#include "msg.h"
#include "session.h"
#include "monitor_mm.h"
#include "monitor.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
#include "monitor_fdpass.h"
#include "version.h"
-/* $OpenBSD: sshlogin.c,v 1.24 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: sshlogin.c,v 1.25 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <sys/types.h>
#include <sys/param.h>
+#include <sys/socket.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
-/* $OpenBSD: sshlogin.h,v 1.7 2006/07/08 21:47:12 stevesk Exp $ */
+/* $OpenBSD: sshlogin.h,v 1.8 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* incompatible with the protocol description in the RFC file, it must be
* called by a name other than "ssh" or "Secure Shell".
*/
-#ifndef SSHLOGIN_H
-#define SSHLOGIN_H
-
-#include <sys/types.h>
-#include <sys/socket.h>
void record_login(pid_t, const char *, const char *, uid_t,
const char *, struct sockaddr *, socklen_t);
void record_utmp_only(pid_t, const char *, const char *, const char *,
struct sockaddr *, socklen_t);
#endif
-
-#endif
-/* $OpenBSD: sshpty.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: sshpty.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
-#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <sys/stat.h>
#include <signal.h>
# include <paths.h>
#endif
#include <pwd.h>
+#include <stdarg.h>
#include <string.h>
#include <termios.h>
#ifdef HAVE_UTIL_H
# include <util.h>
-#endif /* HAVE_UTIL_H */
+#endif
#include <unistd.h>
#include "sshpty.h"
-/* $OpenBSD: sshpty.h,v 1.9 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: sshpty.h,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* called by a name other than "ssh" or "Secure Shell".
*/
-#ifndef SSHPTY_H
-#define SSHPTY_H
-
-#include <sys/types.h>
-
-#include <pwd.h>
#include <termios.h>
struct termios get_saved_tio(void);
void pty_make_controlling_tty(int *, const char *);
void pty_change_window_size(int, u_int, u_int, u_int, u_int);
void pty_setowner(struct passwd *, const char *);
-
-#endif /* SSHPTY_H */
-/* $OpenBSD: sshtty.c,v 1.11 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: sshtty.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
#include <stdio.h>
#include <termios.h>
+#include <pwd.h>
#include "sshpty.h"
-/* $OpenBSD: ttymodes.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: ttymodes.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
+#include <sys/types.h>
+
#include <errno.h>
#include <string.h>
#include <termios.h>
+#include <stdarg.h>
#include "packet.h"
#include "log.h"
#include "ssh1.h"
#include "compat.h"
#include "buffer.h"
-#include "bufaux.h"
#define TTY_OP_END 0
/*
-/* $OpenBSD: uidswap.c,v 1.34 2006/07/26 02:35:17 stevesk Exp $ */
+/* $OpenBSD: uidswap.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
-#include <sys/types.h>
#include <sys/param.h>
-
#include <errno.h>
#include <pwd.h>
#include <string.h>
#include <unistd.h>
+#include <stdarg.h>
#include <grp.h>
-/* $OpenBSD: uidswap.h,v 1.12 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: uidswap.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* called by a name other than "ssh" or "Secure Shell".
*/
-#ifndef UIDSWAP_H
-#define UIDSWAP_H
-
-#include <sys/types.h>
-
-#include <pwd.h>
-
void temporarily_use_uid(struct passwd *);
void restore_uid(void);
void permanently_set_uid(struct passwd *);
void permanently_drop_suid(uid_t);
-
-#endif /* UIDSWAP_H */
-/* $OpenBSD: uuencode.c,v 1.23 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: uuencode.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "includes.h"
#include <sys/types.h>
-
#include <netinet/in.h>
-
#include <resolv.h>
#include <stdio.h>
-/* $OpenBSD: uuencode.h,v 1.12 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: uuencode.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef UUENCODE_H
-#define UUENCODE_H
-
-#include <stdio.h>
-
int uuencode(const u_char *, u_int, char *, size_t);
int uudecode(const char *, u_char *, size_t);
void dump_base64(FILE *, u_char *, u_int);
-#endif
-/* $OpenBSD: xmalloc.c,v 1.26 2006/08/01 23:22:48 stevesk Exp $ */
+/* $OpenBSD: xmalloc.c,v 1.27 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
#include <sys/param.h>
-
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-/* $OpenBSD: xmalloc.h,v 1.12 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: xmalloc.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* called by a name other than "ssh" or "Secure Shell".
*/
-#ifndef XMALLOC_H
-#define XMALLOC_H
-
void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
void *xrealloc(void *, size_t, size_t);
int xasprintf(char **, const char *, ...)
__attribute__((__format__ (printf, 2, 3)))
__attribute__((__nonnull__ (2)));
-
-#endif /* XMALLOC_H */