From 84af61555a62e39c583522ec1ab356cd595846b3 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 12 Feb 2006 11:59:08 +1100 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Make loop counter unsigned to silence compiler warning, from vinschen at redhat.com. --- openbsd-compat/bsd-cygwin_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index b5e3cc52b..96be7fecd 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -29,7 +29,7 @@ #include "includes.h" -RCSID("$Id: bsd-cygwin_util.c,v 1.14 2005/05/25 09:42:11 dtucker Exp $"); +RCSID("$Id: bsd-cygwin_util.c,v 1.15 2006/02/12 00:59:09 dtucker Exp $"); #ifdef HAVE_CYGWIN @@ -268,7 +268,7 @@ char ** fetch_windows_environment(void) { char **e, **p; - int i, idx = 0; + unsigned int i, idx = 0; p = xmalloc((WENV_SIZ + 1) * sizeof(char *)); for (e = environ; *e != NULL; ++e) { -- cgit v1.2.3 From 4881c371cef5e3c1065d7dfa314fffc3a5ab0256 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 19 Feb 2006 22:50:20 +1100 Subject: - (dtucker) [Makefile.in configure.ac, added openbsd-compat/regress/] Add first attempt at regress tests for compat library. ok djm@ --- ChangeLog | 6 ++- Makefile.in | 5 ++- configure.ac | 6 +-- openbsd-compat/regress/Makefile.in | 39 +++++++++++++++++++ openbsd-compat/regress/snprintftest.c | 72 +++++++++++++++++++++++++++++++++++ openbsd-compat/regress/strduptest.c | 42 ++++++++++++++++++++ openbsd-compat/regress/strtonumtest.c | 66 ++++++++++++++++++++++++++++++++ 7 files changed, 231 insertions(+), 5 deletions(-) create mode 100644 openbsd-compat/regress/Makefile.in create mode 100644 openbsd-compat/regress/snprintftest.c create mode 100644 openbsd-compat/regress/strduptest.c create mode 100644 openbsd-compat/regress/strtonumtest.c (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index fd1d9d2ba..67369376f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20060219 + - (dtucker) [Makefile.in configure.ac, added openbsd-compat/regress/] + Add first attempt at regress tests for compat library. ok djm@ + 20060214 - (tim) [buildpkg.sh.in] Make the names consistent. s/pkg_post_make_install_fixes.sh/pkg-post-make-install-fixes.sh/ OK dtucker@ @@ -3859,4 +3863,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4129 2006/02/13 20:46:44 tim Exp $ +$Id: ChangeLog,v 1.4130 2006/02/19 11:50:20 dtucker Exp $ diff --git a/Makefile.in b/Makefile.in index af881c521..1baffb4df 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.274 2006/01/01 08:47:05 djm Exp $ +# $Id: Makefile.in,v 1.275 2006/02/19 11:50:20 dtucker Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -410,6 +410,9 @@ tests: $(TARGETS) EXEEXT="$(EXEEXT)" \ $@ +compat-tests: $(LIBCOMPAT) + (cd openbsd-compat/regress && $(MAKE)) + regressclean: if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \ (cd regress && $(MAKE) clean) \ diff --git a/configure.ac b/configure.ac index 7fcca216a..c4feaf752 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.329 2006/02/12 02:37:48 tim Exp $ +# $Id: configure.ac,v 1.330 2006/02/19 11:50:20 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.329 $) +AC_REVISION($Revision: 1.330 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -3729,7 +3729,7 @@ CFLAGS="$CFLAGS $werror_flags" AC_EXEEXT AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \ - scard/Makefile ssh_prng_cmds survey.sh]) + openbsd-compat/regress/Makefile scard/Makefile ssh_prng_cmds survey.sh]) AC_OUTPUT # Print summary of options diff --git a/openbsd-compat/regress/Makefile.in b/openbsd-compat/regress/Makefile.in new file mode 100644 index 000000000..51383a777 --- /dev/null +++ b/openbsd-compat/regress/Makefile.in @@ -0,0 +1,39 @@ +# $Id: Makefile.in,v 1.1 2006/02/19 11:50:20 dtucker Exp $ + +sysconfdir=@sysconfdir@ +piddir=@piddir@ +srcdir=@srcdir@ +top_srcdir=@top_srcdir@ + +VPATH=@srcdir@ +CC=@CC@ +LD=@LD@ +CFLAGS=@CFLAGS@ +CPPFLAGS=-I. -I.. -I$(srcdir) -I$(srcdir)/.. @CPPFLAGS@ @DEFS@ +LIBS=@LIBS@ +LDFLAGS=-L.. -lopenbsd-compat @LDFLAGS@ + +LIBCOMPAT=../libopenbsd-compat.a +TESTPROGS=strtonumtest strduptest snprintftest + +all: t-exec ${OTHERTESTS} + +t-exec: $(TESTPROGS) + @echo running compat regress tests + @for TEST in ""$?; do \ + echo "run test $${TEST}" ... 1>&2; \ + ./$${TEST} || exit $$? ; \ + done + @echo finished compat regress tests + +strtonumtest: strtonumtest.c $(LIBCOMPAT) + $(CC) $(CFLAGS) $(CPPFLAGS) -o strtonumtest $< $(LDFLAGS) + +strduptest: strduptest.c $(LIBCOMPAT) + $(CC) $(CFLAGS) $(CPPFLAGS) -o strduptest $< $(LDFLAGS) + +clean: + rm -f *.o *.a core $(TESTPROGS) valid.out + +distclean: clean + rm -f Makefile *~ diff --git a/openbsd-compat/regress/snprintftest.c b/openbsd-compat/regress/snprintftest.c new file mode 100644 index 000000000..e25bf223f --- /dev/null +++ b/openbsd-compat/regress/snprintftest.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2005 Darren Tucker + * Copyright (c) 2005 Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define BUFSZ 2048 + +#include +#include +#include +#include + +static int failed = 0; + +static void +fail(const char *m) +{ + fprintf(stderr, "%s", m); + failed = 1; +} + +int x_snprintf(char *str, size_t count, const char *fmt, ...) +{ + size_t ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(str, count, fmt, ap); + va_end(ap); + return ret; +} + +int +main(void) +{ + char b[5]; + char *src; + + snprintf(b,5,"123456789"); + if (b[4] != '\0') + fail("snprintf does not correctly terminate long strings"); + + /* check for read overrun on unterminated string */ + if ((src = malloc(BUFSZ)) == NULL) { + fail("malloc failed"); + } else { + memset(src, 'a', BUFSZ); + snprintf(b, sizeof(b), "%.*s", 1, src); + if (strcmp(b, "a") != 0) + fail("failed with length limit '%%.s'"); + } + + /* check that snprintf and vsnprintf return sane values */ + if (snprintf(b, 1, "%s %d", "hello", 12345) != 11) + fail("snprintf does not return required length"); + if (x_snprintf(b, 1, "%s %d", "hello", 12345) != 11) + fail("vsnprintf does not return required length"); + + return failed; +} diff --git a/openbsd-compat/regress/strduptest.c b/openbsd-compat/regress/strduptest.c new file mode 100644 index 000000000..664a48ef4 --- /dev/null +++ b/openbsd-compat/regress/strduptest.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2005 Darren Tucker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +static int fail = 0; + +void +test(const char *a) +{ + char *b; + + b = strdup(a); + if (b == 0) { + fail = 1; + return; + } + if (strcmp(a, b) != 0) + fail = 1; + free(b); +} + +int +main(void) +{ + test(""); + test("a"); + test("\0"); + test("abcdefghijklmnopqrstuvwxyz"); + return fail; +} diff --git a/openbsd-compat/regress/strtonumtest.c b/openbsd-compat/regress/strtonumtest.c new file mode 100644 index 000000000..cb8585129 --- /dev/null +++ b/openbsd-compat/regress/strtonumtest.c @@ -0,0 +1,66 @@ +/* $OpenBSD: strtonumtest.c,v 1.1 2004/08/03 20:38:36 otto Exp $ */ +/* + * Copyright (c) 2004 Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* OPENBSD ORIGINAL: regress/lib/libc/strtonum/strtonumtest.c */ + +#include +#include +#include + +int fail; + +void +test(const char *p, long long lb, long long ub, int ok) +{ + long long val; + const char *q; + + val = strtonum(p, lb, ub, &q); + if (ok && q != NULL) { + fprintf(stderr, "%s [%lld-%lld] ", p, lb, ub); + fprintf(stderr, "NUMBER NOT ACCEPTED %s\n", q); + fail = 1; + } else if (!ok && q == NULL) { + fprintf(stderr, "%s [%lld-%lld] %lld ", p, lb, ub, val); + fprintf(stderr, "NUMBER ACCEPTED\n"); + fail = 1; + } +} + +int main(int argc, char *argv[]) +{ + test("1", 0, 10, 1); + test("0", -2, 5, 1); + test("0", 2, 5, 0); + test("0", 2, LLONG_MAX, 0); + test("-2", 0, LLONG_MAX, 0); + test("0", -5, LLONG_MAX, 1); + test("-3", -3, LLONG_MAX, 1); + test("-9223372036854775808", LLONG_MIN, LLONG_MAX, 1); + test("9223372036854775807", LLONG_MIN, LLONG_MAX, 1); + test("-9223372036854775809", LLONG_MIN, LLONG_MAX, 0); + test("9223372036854775808", LLONG_MIN, LLONG_MAX, 0); + test("1000000000000000000000000", LLONG_MIN, LLONG_MAX, 0); + test("-1000000000000000000000000", LLONG_MIN, LLONG_MAX, 0); + test("-2", 10, -1, 0); + test("-2", -10, -1, 1); + test("-20", -10, -1, 0); + test("20", -10, -1, 0); + + return (fail); +} + -- cgit v1.2.3 From fabdb6c29022846ed10fde235db0a7c53f21a6b1 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 20 Feb 2006 20:17:35 +1100 Subject: - (dtucker) [INSTALL configure.ac openbsd-compat/openssl-compat.{c,h}] Add optional enabling of OpenSSL's (hardware) Engine support, via configure --with-ssl-engine. Based in part on a diff by michal at logix.cz. --- ChangeLog | 8 +++++++- INSTALL | 4 +++- configure.ac | 22 ++++++++++++++++++++-- openbsd-compat/openssl-compat.c | 20 ++++++++++++++++++-- openbsd-compat/openssl-compat.h | 15 ++++++++------- 5 files changed, 56 insertions(+), 13 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 67369376f..2c0bd1e9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20060220 + - (dtucker) [INSTALL configure.ac openbsd-compat/openssl-compat.{c,h}] + Add optional enabling of OpenSSL's (hardware) Engine support, via + configure --with-ssl-engine. Based in part on a diff by michal at + logix.cz. + 20060219 - (dtucker) [Makefile.in configure.ac, added openbsd-compat/regress/] Add first attempt at regress tests for compat library. ok djm@ @@ -3863,4 +3869,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4130 2006/02/19 11:50:20 dtucker Exp $ +$Id: ChangeLog,v 1.4131 2006/02/20 09:17:35 dtucker Exp $ diff --git a/INSTALL b/INSTALL index 753d2d061..38f39473f 100644 --- a/INSTALL +++ b/INSTALL @@ -165,6 +165,8 @@ created. --with-ssl-dir=DIR allows you to specify where your OpenSSL libraries are installed. +--with-ssl-engine enables OpenSSL's (hardware) ENGINE support + --with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to real (AF_INET) IPv4 addresses. Works around some quirks on Linux. @@ -225,4 +227,4 @@ Please refer to the "reporting bugs" section of the webpage at http://www.openssh.com/ -$Id: INSTALL,v 1.70 2005/04/24 07:52:23 dtucker Exp $ +$Id: INSTALL,v 1.71 2006/02/20 09:17:36 dtucker Exp $ diff --git a/configure.ac b/configure.ac index c4feaf752..eb24fa00e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.330 2006/02/19 11:50:20 dtucker Exp $ +# $Id: configure.ac,v 1.331 2006/02/20 09:17:36 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.330 $) +AC_REVISION($Revision: 1.331 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -1834,6 +1834,24 @@ Also see contrib/findssl.sh for help identifying header/library mismatches.]) ] ) +AC_ARG_WITH(ssl-engine, + [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], + [ if test "x$withval" != "xno" ; then + AC_MSG_CHECKING(for OpenSSL ENGINE support) + AC_TRY_COMPILE( + [ #include ], + [ +int main(void){ENGINE_load_builtin_engines();ENGINE_register_all_complete();} + ], + [ AC_MSG_RESULT(yes) + AC_DEFINE(USE_OPENSSL_ENGINE, 1, + [Enable OpenSSL engine support]) + ], + [ AC_MSG_ERROR(OpenSSL ENGINE support not found)] + ) + fi ] +) + # Check for OpenSSL without EVP_aes_{192,256}_cbc AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) AC_COMPILE_IFELSE( diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index b690e8fe6..763f84734 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.c,v 1.2 2005/06/17 11:15:21 dtucker Exp $ */ +/* $Id: openssl-compat.c,v 1.3 2006/02/20 09:17:36 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -18,7 +18,11 @@ #include "includes.h" -#define SSH_DONT_REDEF_EVP +#ifdef USE_OPENSSL_ENGINE +# include +#endif + +#define SSH_DONT_OVERLOAD_OPENSSL_FUNCS #include "openssl-compat.h" #ifdef SSH_OLD_EVP @@ -44,3 +48,15 @@ ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *evp) return 1; } #endif + +void +ssh_SSLeay_add_all_algorithms(void) +{ + SSLeay_add_all_algorithms(); + +#ifdef USE_OPENSSL_ENGINE + /* Enable use of crypto hardware */ + ENGINE_load_builtin_engines(); + ENGINE_register_all_complete(); +#endif +} diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 8a015ec43..1196d71ea 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.3 2005/12/19 06:40:40 dtucker Exp $ */ +/* $Id: openssl-compat.h,v 1.4 2006/02/20 09:17:36 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -54,21 +54,22 @@ extern const EVP_CIPHER *evp_acss(void); * define SSH_DONT_OVERLOAD_OPENSSL_FUNCS before including this file and * implement the ssh_* equivalents. */ -#ifdef SSH_OLD_EVP - -# ifndef SSH_DONT_REDEF_EVP +#ifndef SSH_DONT_OVERLOAD_OPENSSL_FUNCS +# ifdef SSH_OLD_EVP # ifdef EVP_Cipher # undef EVP_Cipher # endif - # define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) # define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) -# endif +# endif /* SSH_OLD_EVP */ + +# define SSLeay_add_all_algorithms() ssh_SSLeay_add_all_algorithms() +void ssh_SSLeay_add_all_algorithms(void); int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, unsigned char *, int); int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); -#endif +#endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ -- cgit v1.2.3 From 3322e0d421676a6931fe01efdd5e0f34af8e5da2 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 22 Feb 2006 00:00:27 +1100 Subject: - (dtucker) [openbsd-compat/openssl-compat.h] Prevent warning about redefinition of SSLeay_add_all_algorithms. --- ChangeLog | 6 +++++- openbsd-compat/openssl-compat.h | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 2c0bd1e9d..43d09104f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20060221 + - (dtucker) [openbsd-compat/openssl-compat.h] Prevent warning about + redefinition of SSLeay_add_all_algorithms. + 20060220 - (dtucker) [INSTALL configure.ac openbsd-compat/openssl-compat.{c,h}] Add optional enabling of OpenSSL's (hardware) Engine support, via @@ -3869,4 +3873,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4131 2006/02/20 09:17:35 dtucker Exp $ +$Id: ChangeLog,v 1.4132 2006/02/21 13:00:27 dtucker Exp $ diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 1196d71ea..01fc41e3a 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.4 2006/02/20 09:17:36 dtucker Exp $ */ +/* $Id: openssl-compat.h,v 1.5 2006/02/21 13:00:28 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -65,8 +65,13 @@ extern const EVP_CIPHER *evp_acss(void); # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) # endif /* SSH_OLD_EVP */ -# define SSLeay_add_all_algorithms() ssh_SSLeay_add_all_algorithms() +# ifdef USE_OPENSSL_ENGINE +# ifdef SSLeay_add_all_algorithms +# undef SSLeay_add_all_algorithms +# endif +# define SSLeay_add_all_algorithms() ssh_SSLeay_add_all_algorithms() void ssh_SSLeay_add_all_algorithms(void); +#endif int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, unsigned char *, int); -- cgit v1.2.3 From 94413cf32ba932537ef215b07eb1833e297fcae5 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 22 Feb 2006 22:24:47 +1100 Subject: - (dtucker) [openbsd-compat/openssl-compat.{c,h}] Minor tidy up: only compile in compat code if required. --- ChangeLog | 6 +++++- openbsd-compat/openssl-compat.c | 6 +++--- openbsd-compat/openssl-compat.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 43d09104f..f942c2453 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006022 + - (dtucker) [openbsd-compat/openssl-compat.{c,h}] Minor tidy up: only + compile in compat code if required. + 20060221 - (dtucker) [openbsd-compat/openssl-compat.h] Prevent warning about redefinition of SSLeay_add_all_algorithms. @@ -3873,4 +3877,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4132 2006/02/21 13:00:27 dtucker Exp $ +$Id: ChangeLog,v 1.4133 2006/02/22 11:24:47 dtucker Exp $ diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 763f84734..45ebd3f66 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.c,v 1.3 2006/02/20 09:17:36 dtucker Exp $ */ +/* $Id: openssl-compat.c,v 1.4 2006/02/22 11:24:47 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -49,14 +49,14 @@ ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *evp) } #endif +#ifdef USE_OPENSSL_ENGINE void ssh_SSLeay_add_all_algorithms(void) { SSLeay_add_all_algorithms(); -#ifdef USE_OPENSSL_ENGINE /* Enable use of crypto hardware */ ENGINE_load_builtin_engines(); ENGINE_register_all_complete(); -#endif } +#endif diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 01fc41e3a..c582cd269 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.5 2006/02/21 13:00:28 dtucker Exp $ */ +/* $Id: openssl-compat.h,v 1.6 2006/02/22 11:24:47 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -70,11 +70,11 @@ extern const EVP_CIPHER *evp_acss(void); # undef SSLeay_add_all_algorithms # endif # define SSLeay_add_all_algorithms() ssh_SSLeay_add_all_algorithms() -void ssh_SSLeay_add_all_algorithms(void); #endif int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, unsigned char *, int); int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); +void ssh_SSLeay_add_all_algorithms(void); #endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ -- cgit v1.2.3 From af87af165f25b7db22e32c0b2e55606bc68c450c Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 13:02:28 +1100 Subject: - (djm) [configure.ac defines.h kex.c md-sha256.c] [openbsd-compat/sha2.h openbsd-compat/openbsd-compat.h] [openbsd-compat/sha2.c] First stab at portability glue for SHA256 KEX support, should work with libc SHA256 support or OpenSSL EVP_sha256 if present --- ChangeLog | 7 +- configure.ac | 15 +- defines.h | 18 +- kex.c | 4 + md-sha256.c | 7 +- openbsd-compat/openbsd-compat.h | 4 +- openbsd-compat/sha2.c | 876 ++++++++++++++++++++++++++++++++++++++++ openbsd-compat/sha2.h | 125 ++++++ openbsd-compat/xmmap.c | 4 +- 9 files changed, 1047 insertions(+), 13 deletions(-) create mode 100644 openbsd-compat/sha2.c create mode 100644 openbsd-compat/sha2.h (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 3cd994f2c..db0a4f633 100644 --- a/ChangeLog +++ b/ChangeLog @@ -242,6 +242,11 @@ using the SHA256 code in libc (and wrapper to make it into an OpenSSL EVP), interop tested against CVS PuTTY NB. no portability bits committed yet + - (djm) [configure.ac defines.h kex.c md-sha256.c] + [openbsd-compat/sha2.h openbsd-compat/openbsd-compat.h] + [openbsd-compat/sha2.c] First stab at portability glue for SHA256 + KEX support, should work with libc SHA256 support or OpenSSL + EVP_sha256 if present 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4143,4 +4148,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4207 2006/03/15 01:08:28 djm Exp $ +$Id: ChangeLog,v 1.4208 2006/03/15 02:02:28 djm Exp $ diff --git a/configure.ac b/configure.ac index adef4f675..160493f06 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.333 2006/03/13 08:06:51 dtucker Exp $ +# $Id: configure.ac,v 1.334 2006/03/15 02:02:28 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.333 $) +AC_REVISION($Revision: 1.334 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -923,11 +923,9 @@ AC_EGREP_CPP(FOUNDIT, # Check for g.gl_matchc glob() extension AC_MSG_CHECKING(for gl_matchc field in glob_t) -AC_EGREP_CPP(FOUNDIT, - [ - #include - int main(void){glob_t g; g.gl_matchc = 1;} - ], +AC_TRY_COMPILE(FOUNDIT, + [ #include ], + [glob_t g; g.gl_matchc = 1;], [ AC_DEFINE(GLOB_HAS_GL_MATCHC, 1, [Define if your system glob() function has @@ -1883,6 +1881,9 @@ if test "x$check_for_libcrypt_later" = "x1"; then AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") fi +# Search for SHA256 support in libc and/or OpenSSL +AC_CHECK_FUNCS(SHA256_Update EVP_sha256) + AC_CHECK_LIB(iaf, ia_openinfo) ### Configure cryptographic random number support diff --git a/defines.h b/defines.h index f25934176..9ecf18d5a 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.130 2005/12/17 11:04:09 dtucker Exp $ */ +/* $Id: defines.h,v 1.131 2006/03/15 02:02:28 djm Exp $ */ /* Constants */ @@ -496,6 +496,22 @@ struct winsize { # define offsetof(type, member) ((size_t) &((type *)0)->member) #endif +/* Set up BSD-style BYTE_ORDER definition if it isn't there already */ +/* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */ +#ifndef BYTE_ORDER +# ifndef LITTLE_ENDIAN +# define LITTLE_ENDIAN 1234 +# endif /* LITTLE_ENDIAN */ +# ifndef BIG_ENDIAN +# define BIG_ENDIAN 4321 +# endif /* BIG_ENDIAN */ +# ifdef WORDS_BIGENDIAN +# define BYTE_ORDER BIG_ENDIAN +# else /* WORDS_BIGENDIAN */ +# define BYTE_ORDER LITTLE_ENDIAN +# endif /* WORDS_BIGENDIAN */ +#endif /* BYTE_ORDER */ + /* Function replacement / compatibility hacks */ #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO)) diff --git a/kex.c b/kex.c index 175613b40..70c2c9709 100644 --- a/kex.c +++ b/kex.c @@ -44,7 +44,11 @@ RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $"); #define KEX_COOKIE_LEN 16 +#ifdef HAVE_EVP_SHA256 +# define evp_ssh_sha256 EVP_sha256 +#else /* HAVE_EVP_SHA256 */ extern const EVP_MD *evp_ssh_sha256(void); +#endif /* HAVE_EVP_SHA256 */ /* prototype */ static void kex_kexinit_finish(Kex *); diff --git a/md-sha256.c b/md-sha256.c index 08848f841..82c526d33 100644 --- a/md-sha256.c +++ b/md-sha256.c @@ -17,8 +17,10 @@ /* EVP wrapper for SHA256 */ #include "includes.h" + +#ifndef HAVE_EVP_SHA256 + #include -#include RCSID("$OpenBSD: md-sha256.c,v 1.1 2006/03/07 09:07:40 djm Exp $"); @@ -69,3 +71,6 @@ evp_ssh_sha256(void) return (&ssh_sha256); } + +#endif /* HAVE_EVP_SHA256 */ + diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 1a3027353..9022c793f 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.33 2005/12/31 05:33:37 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.34 2006/03/15 02:02:31 djm Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -38,7 +38,7 @@ #include "readpassphrase.h" #include "vis.h" #include "getrrsetbyname.h" - +#include "sha2.h" #ifndef HAVE_BASENAME char *basename(const char *path); diff --git a/openbsd-compat/sha2.c b/openbsd-compat/sha2.c new file mode 100644 index 000000000..d04fb25f7 --- /dev/null +++ b/openbsd-compat/sha2.c @@ -0,0 +1,876 @@ +/* $OpenBSD: sha2.c,v 1.11 2005/08/08 08:05:35 espie Exp $ */ + +/* + * FILE: sha2.c + * AUTHOR: Aaron D. Gifford + * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $ + */ + +/* OPENBSD ORIGINAL: lib/libc/hash/sha2.c */ + +#include "includes.h" + +#if !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) +#include +#include +#include "sha2.h" + +/* + * UNROLLED TRANSFORM LOOP NOTE: + * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform + * loop version for the hash transform rounds (defined using macros + * later in this file). Either define on the command line, for example: + * + * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c + * + * or define below: + * + * #define SHA2_UNROLL_TRANSFORM + * + */ + +/*** SHA-256/384/512 Machine Architecture Definitions *****************/ +/* + * BYTE_ORDER NOTE: + * + * Please make sure that your system defines BYTE_ORDER. If your + * architecture is little-endian, make sure it also defines + * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are + * equivilent. + * + * If your system does not define the above, then you can do so by + * hand like this: + * + * #define LITTLE_ENDIAN 1234 + * #define BIG_ENDIAN 4321 + * + * And for little-endian machines, add: + * + * #define BYTE_ORDER LITTLE_ENDIAN + * + * Or for big-endian machines: + * + * #define BYTE_ORDER BIG_ENDIAN + * + * The FreeBSD machine this was written on defines BYTE_ORDER + * appropriately by including (which in turn includes + * where the appropriate definitions are actually + * made). + */ +#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) +#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN +#endif + + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +/* NOTE: Most of these are in sha2.h */ +#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) +#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) +#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) + +/*** ENDIAN SPECIFIC COPY MACROS **************************************/ +#define BE_8_TO_32(dst, cp) do { \ + (dst) = (u_int32_t)(cp)[3] | ((u_int32_t)(cp)[2] << 8) | \ + ((u_int32_t)(cp)[1] << 16) | ((u_int32_t)(cp)[0] << 24); \ +} while(0) + +#define BE_8_TO_64(dst, cp) do { \ + (dst) = (u_int64_t)(cp)[7] | ((u_int64_t)(cp)[6] << 8) | \ + ((u_int64_t)(cp)[5] << 16) | ((u_int64_t)(cp)[4] << 24) | \ + ((u_int64_t)(cp)[3] << 32) | ((u_int64_t)(cp)[2] << 40) | \ + ((u_int64_t)(cp)[1] << 48) | ((u_int64_t)(cp)[0] << 56); \ +} while (0) + +#define BE_64_TO_8(cp, src) do { \ + (cp)[0] = (src) >> 56; \ + (cp)[1] = (src) >> 48; \ + (cp)[2] = (src) >> 40; \ + (cp)[3] = (src) >> 32; \ + (cp)[4] = (src) >> 24; \ + (cp)[5] = (src) >> 16; \ + (cp)[6] = (src) >> 8; \ + (cp)[7] = (src); \ +} while (0) + +#define BE_32_TO_8(cp, src) do { \ + (cp)[0] = (src) >> 24; \ + (cp)[1] = (src) >> 16; \ + (cp)[2] = (src) >> 8; \ + (cp)[3] = (src); \ +} while (0) + +/* + * Macro for incrementally adding the unsigned 64-bit integer n to the + * unsigned 128-bit integer (represented using a two-element array of + * 64-bit words): + */ +#define ADDINC128(w,n) do { \ + (w)[0] += (u_int64_t)(n); \ + if ((w)[0] < (n)) { \ + (w)[1]++; \ + } \ +} while (0) + +/*** THE SIX LOGICAL FUNCTIONS ****************************************/ +/* + * Bit shifting and rotation (used by the six SHA-XYZ logical functions: + * + * NOTE: The naming of R and S appears backwards here (R is a SHIFT and + * S is a ROTATION) because the SHA-256/384/512 description document + * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this + * same "backwards" definition. + */ +/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ +#define R(b,x) ((x) >> (b)) +/* 32-bit Rotate-right (used in SHA-256): */ +#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) +/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ +#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) + +/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ +#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + +/* Four of six logical functions used in SHA-256: */ +#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) +#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) +#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) +#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) + +/* Four of six logical functions used in SHA-384 and SHA-512: */ +#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) +#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) +#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) +#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) + + +/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ +/* Hash constant words K for SHA-256: */ +const static u_int32_t K256[64] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, + 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, + 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, + 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, + 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, + 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, + 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, + 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, + 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, + 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, + 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, + 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, + 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL +}; + +/* Initial hash value H for SHA-256: */ +const static u_int32_t sha256_initial_hash_value[8] = { + 0x6a09e667UL, + 0xbb67ae85UL, + 0x3c6ef372UL, + 0xa54ff53aUL, + 0x510e527fUL, + 0x9b05688cUL, + 0x1f83d9abUL, + 0x5be0cd19UL +}; + +/* Hash constant words K for SHA-384 and SHA-512: */ +const static u_int64_t K512[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL +}; + +/* Initial hash value H for SHA-384 */ +const static u_int64_t sha384_initial_hash_value[8] = { + 0xcbbb9d5dc1059ed8ULL, + 0x629a292a367cd507ULL, + 0x9159015a3070dd17ULL, + 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, + 0x8eb44a8768581511ULL, + 0xdb0c2e0d64f98fa7ULL, + 0x47b5481dbefa4fa4ULL +}; + +/* Initial hash value H for SHA-512 */ +const static u_int64_t sha512_initial_hash_value[8] = { + 0x6a09e667f3bcc908ULL, + 0xbb67ae8584caa73bULL, + 0x3c6ef372fe94f82bULL, + 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, + 0x9b05688c2b3e6c1fULL, + 0x1f83d9abfb41bd6bULL, + 0x5be0cd19137e2179ULL +}; + + +/*** SHA-256: *********************************************************/ +void +SHA256_Init(SHA256_CTX *context) +{ + if (context == NULL) + return; + memcpy(context->state, sha256_initial_hash_value, + sizeof(sha256_initial_hash_value)); + memset(context->buffer, 0, sizeof(context->buffer)); + context->bitcount = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-256 round macros: */ + +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) do { \ + BE_8_TO_32(W256[j], data); \ + data += 4; \ + T1 = (h) + Sigma1_256((e)) + Ch((e), (f), (g)) + K256[j] + W256[j]; \ + (d) += T1; \ + (h) = T1 + Sigma0_256((a)) + Maj((a), (b), (c)); \ + j++; \ +} while(0) + +#define ROUND256(a,b,c,d,e,f,g,h) do { \ + s0 = W256[(j+1)&0x0f]; \ + s0 = sigma0_256(s0); \ + s1 = W256[(j+14)&0x0f]; \ + s1 = sigma1_256(s1); \ + T1 = (h) + Sigma1_256((e)) + Ch((e), (f), (g)) + K256[j] + \ + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_256((a)) + Maj((a), (b), (c)); \ + j++; \ +} while(0) + +void +SHA256_Transform(u_int32_t state[8], const u_int8_t data[SHA256_BLOCK_LENGTH]) +{ + u_int32_t a, b, c, d, e, f, g, h, s0, s1; + u_int32_t T1, W256[16]; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + j = 0; + do { + /* Rounds 0 to 15 (unrolled): */ + ROUND256_0_TO_15(a,b,c,d,e,f,g,h); + ROUND256_0_TO_15(h,a,b,c,d,e,f,g); + ROUND256_0_TO_15(g,h,a,b,c,d,e,f); + ROUND256_0_TO_15(f,g,h,a,b,c,d,e); + ROUND256_0_TO_15(e,f,g,h,a,b,c,d); + ROUND256_0_TO_15(d,e,f,g,h,a,b,c); + ROUND256_0_TO_15(c,d,e,f,g,h,a,b); + ROUND256_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds up to 63: */ + do { + ROUND256(a,b,c,d,e,f,g,h); + ROUND256(h,a,b,c,d,e,f,g); + ROUND256(g,h,a,b,c,d,e,f); + ROUND256(f,g,h,a,b,c,d,e); + ROUND256(e,f,g,h,a,b,c,d); + ROUND256(d,e,f,g,h,a,b,c); + ROUND256(c,d,e,f,g,h,a,b); + ROUND256(b,c,d,e,f,g,h,a); + } while (j < 64); + + /* Compute the current intermediate hash value */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void +SHA256_Transform(u_int32_t state[8], const u_int8_t data[SHA256_BLOCK_LENGTH]) +{ + u_int32_t a, b, c, d, e, f, g, h, s0, s1; + u_int32_t T1, T2, W256[16]; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + j = 0; + do { + BE_8_TO_32(W256[j], data); + data += 4; + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W256[(j+1)&0x0f]; + s0 = sigma0_256(s0); + s1 = W256[(j+14)&0x0f]; + s1 = sigma1_256(s1); + + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 64); + + /* Compute the current intermediate hash value */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void +SHA256_Update(SHA256_CTX *context, const u_int8_t *data, size_t len) +{ + size_t freespace, usedspace; + + /* Calling with no data is valid (we do nothing) */ + if (len == 0) + return; + + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA256_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + memcpy(&context->buffer[usedspace], data, freespace); + context->bitcount += freespace << 3; + len -= freespace; + data += freespace; + SHA256_Transform(context->state, context->buffer); + } else { + /* The buffer is not yet full */ + memcpy(&context->buffer[usedspace], data, len); + context->bitcount += len << 3; + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA256_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA256_Transform(context->state, data); + context->bitcount += SHA256_BLOCK_LENGTH << 3; + len -= SHA256_BLOCK_LENGTH; + data += SHA256_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + memcpy(context->buffer, data, len); + context->bitcount += len << 3; + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void +SHA256_Pad(SHA256_CTX *context) +{ + unsigned int usedspace; + + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + memset(&context->buffer[usedspace], 0, + SHA256_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA256_BLOCK_LENGTH) { + memset(&context->buffer[usedspace], 0, + SHA256_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA256_Transform(context->state, context->buffer); + + /* Prepare for last transform: */ + memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH); + } + } else { + /* Set-up for the last transform: */ + memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Store the length of input data (in bits) in big endian format: */ + BE_64_TO_8(&context->buffer[SHA256_SHORT_BLOCK_LENGTH], + context->bitcount); + + /* Final transform: */ + SHA256_Transform(context->state, context->buffer); + + /* Clean up: */ + usedspace = 0; +} + +void +SHA256_Final(u_int8_t digest[SHA256_DIGEST_LENGTH], SHA256_CTX *context) +{ + SHA256_Pad(context); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != NULL) { +#if BYTE_ORDER == LITTLE_ENDIAN + int i; + + /* Convert TO host byte order */ + for (i = 0; i < 8; i++) + BE_32_TO_8(digest + i * 4, context->state[i]); +#else + memcpy(digest, context->state, SHA256_DIGEST_LENGTH); +#endif + memset(context, 0, sizeof(*context)); + } +} + + +/*** SHA-512: *********************************************************/ +void +SHA512_Init(SHA512_CTX *context) +{ + if (context == NULL) + return; + memcpy(context->state, sha512_initial_hash_value, + sizeof(sha512_initial_hash_value)); + memset(context->buffer, 0, sizeof(context->buffer)); + context->bitcount[0] = context->bitcount[1] = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-512 round macros: */ + +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) do { \ + BE_8_TO_64(W512[j], data); \ + data += 8; \ + T1 = (h) + Sigma1_512((e)) + Ch((e), (f), (g)) + K512[j] + W512[j]; \ + (d) += T1; \ + (h) = T1 + Sigma0_512((a)) + Maj((a), (b), (c)); \ + j++; \ +} while(0) + + +#define ROUND512(a,b,c,d,e,f,g,h) do { \ + s0 = W512[(j+1)&0x0f]; \ + s0 = sigma0_512(s0); \ + s1 = W512[(j+14)&0x0f]; \ + s1 = sigma1_512(s1); \ + T1 = (h) + Sigma1_512((e)) + Ch((e), (f), (g)) + K512[j] + \ + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_512((a)) + Maj((a), (b), (c)); \ + j++; \ +} while(0) + +void +SHA512_Transform(u_int64_t state[8], const u_int8_t data[SHA512_BLOCK_LENGTH]) +{ + u_int64_t a, b, c, d, e, f, g, h, s0, s1; + u_int64_t T1, W512[16]; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + j = 0; + do { + /* Rounds 0 to 15 (unrolled): */ + ROUND512_0_TO_15(a,b,c,d,e,f,g,h); + ROUND512_0_TO_15(h,a,b,c,d,e,f,g); + ROUND512_0_TO_15(g,h,a,b,c,d,e,f); + ROUND512_0_TO_15(f,g,h,a,b,c,d,e); + ROUND512_0_TO_15(e,f,g,h,a,b,c,d); + ROUND512_0_TO_15(d,e,f,g,h,a,b,c); + ROUND512_0_TO_15(c,d,e,f,g,h,a,b); + ROUND512_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds up to 79: */ + do { + ROUND512(a,b,c,d,e,f,g,h); + ROUND512(h,a,b,c,d,e,f,g); + ROUND512(g,h,a,b,c,d,e,f); + ROUND512(f,g,h,a,b,c,d,e); + ROUND512(e,f,g,h,a,b,c,d); + ROUND512(d,e,f,g,h,a,b,c); + ROUND512(c,d,e,f,g,h,a,b); + ROUND512(b,c,d,e,f,g,h,a); + } while (j < 80); + + /* Compute the current intermediate hash value */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void +SHA512_Transform(u_int64_t state[8], const u_int8_t data[SHA512_BLOCK_LENGTH]) +{ + u_int64_t a, b, c, d, e, f, g, h, s0, s1; + u_int64_t T1, T2, W512[16]; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + j = 0; + do { + BE_8_TO_64(W512[j], data); + data += 8; + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W512[(j+1)&0x0f]; + s0 = sigma0_512(s0); + s1 = W512[(j+14)&0x0f]; + s1 = sigma1_512(s1); + + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 80); + + /* Compute the current intermediate hash value */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void +SHA512_Update(SHA512_CTX *context, const u_int8_t *data, size_t len) +{ + size_t freespace, usedspace; + + /* Calling with no data is valid (we do nothing) */ + if (len == 0) + return; + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA512_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + memcpy(&context->buffer[usedspace], data, freespace); + ADDINC128(context->bitcount, freespace << 3); + len -= freespace; + data += freespace; + SHA512_Transform(context->state, context->buffer); + } else { + /* The buffer is not yet full */ + memcpy(&context->buffer[usedspace], data, len); + ADDINC128(context->bitcount, len << 3); + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA512_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA512_Transform(context->state, data); + ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); + len -= SHA512_BLOCK_LENGTH; + data += SHA512_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + memcpy(context->buffer, data, len); + ADDINC128(context->bitcount, len << 3); + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void +SHA512_Pad(SHA512_CTX *context) +{ + unsigned int usedspace; + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + memset(&context->buffer[usedspace], 0, SHA512_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA512_BLOCK_LENGTH) { + memset(&context->buffer[usedspace], 0, SHA512_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA512_Transform(context->state, context->buffer); + + /* And set-up for the last transform: */ + memset(context->buffer, 0, SHA512_BLOCK_LENGTH - 2); + } + } else { + /* Prepare for final transform: */ + memset(context->buffer, 0, SHA512_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Store the length of input data (in bits) in big endian format: */ + BE_64_TO_8(&context->buffer[SHA512_SHORT_BLOCK_LENGTH], + context->bitcount[1]); + BE_64_TO_8(&context->buffer[SHA512_SHORT_BLOCK_LENGTH + 8], + context->bitcount[0]); + + /* Final transform: */ + SHA512_Transform(context->state, context->buffer); + + /* Clean up: */ + usedspace = 0; +} + +void +SHA512_Final(u_int8_t digest[SHA512_DIGEST_LENGTH], SHA512_CTX *context) +{ + SHA512_Pad(context); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != NULL) { +#if BYTE_ORDER == LITTLE_ENDIAN + int i; + + /* Convert TO host byte order */ + for (i = 0; i < 8; i++) + BE_64_TO_8(digest + i * 8, context->state[i]); +#else + memcpy(digest, context->state, SHA512_DIGEST_LENGTH); +#endif + memset(context, 0, sizeof(*context)); + } +} + + +/*** SHA-384: *********************************************************/ +void +SHA384_Init(SHA384_CTX *context) +{ + if (context == NULL) + return; + memcpy(context->state, sha384_initial_hash_value, + sizeof(sha384_initial_hash_value)); + memset(context->buffer, 0, sizeof(context->buffer)); + context->bitcount[0] = context->bitcount[1] = 0; +} + +__weak_alias(SHA384_Transform, SHA512_Transform); +__weak_alias(SHA384_Update, SHA512_Update); +__weak_alias(SHA384_Pad, SHA512_Pad); + +void +SHA384_Final(u_int8_t digest[SHA384_DIGEST_LENGTH], SHA384_CTX *context) +{ + SHA384_Pad(context); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != NULL) { +#if BYTE_ORDER == LITTLE_ENDIAN + int i; + + /* Convert TO host byte order */ + for (i = 0; i < 6; i++) + BE_64_TO_8(digest + i * 8, context->state[i]); +#else + memcpy(digest, context->state, SHA384_DIGEST_LENGTH); +#endif + } + + /* Zero out state data */ + memset(context, 0, sizeof(*context)); +} + +#endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ diff --git a/openbsd-compat/sha2.h b/openbsd-compat/sha2.h new file mode 100644 index 000000000..fb40bde43 --- /dev/null +++ b/openbsd-compat/sha2.h @@ -0,0 +1,125 @@ +/* $OpenBSD: sha2.h,v 1.6 2004/06/22 01:57:30 jfb Exp $ */ + +/* + * FILE: sha2.h + * AUTHOR: Aaron D. Gifford + * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $From: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $ + */ + +/* OPENBSD ORIGINAL: include/sha2.h */ + +#ifndef _SHA2_H +#define _SHA2_H + +#include "includes.h" + +#if !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +#define SHA256_BLOCK_LENGTH 64 +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_BLOCK_LENGTH 128 +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_BLOCK_LENGTH 128 +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) + + +/*** SHA-256/384/512 Context Structures *******************************/ +typedef struct _SHA256_CTX { + u_int32_t state[8]; + u_int64_t bitcount; + u_int8_t buffer[SHA256_BLOCK_LENGTH]; +} SHA256_CTX; +typedef struct _SHA512_CTX { + u_int64_t state[8]; + u_int64_t bitcount[2]; + u_int8_t buffer[SHA512_BLOCK_LENGTH]; +} SHA512_CTX; + +typedef SHA512_CTX SHA384_CTX; + +void SHA256_Init(SHA256_CTX *); +void SHA256_Transform(u_int32_t state[8], const u_int8_t [SHA256_BLOCK_LENGTH]); +void SHA256_Update(SHA256_CTX *, const u_int8_t *, size_t) + __attribute__((__bounded__(__string__,2,3))); +void SHA256_Pad(SHA256_CTX *); +void SHA256_Final(u_int8_t [SHA256_DIGEST_LENGTH], SHA256_CTX *) + __attribute__((__bounded__(__minbytes__,1,SHA256_DIGEST_LENGTH))); +char *SHA256_End(SHA256_CTX *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); +char *SHA256_File(const char *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); +char *SHA256_FileChunk(const char *, char *, off_t, off_t) + __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); +char *SHA256_Data(const u_int8_t *, size_t, char *) + __attribute__((__bounded__(__string__,1,2))) + __attribute__((__bounded__(__minbytes__,3,SHA256_DIGEST_STRING_LENGTH))); + +void SHA384_Init(SHA384_CTX *); +void SHA384_Transform(u_int64_t state[8], const u_int8_t [SHA384_BLOCK_LENGTH]); +void SHA384_Update(SHA384_CTX *, const u_int8_t *, size_t) + __attribute__((__bounded__(__string__,2,3))); +void SHA384_Pad(SHA384_CTX *); +void SHA384_Final(u_int8_t [SHA384_DIGEST_LENGTH], SHA384_CTX *) + __attribute__((__bounded__(__minbytes__,1,SHA384_DIGEST_LENGTH))); +char *SHA384_End(SHA384_CTX *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); +char *SHA384_File(const char *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); +char *SHA384_FileChunk(const char *, char *, off_t, off_t) + __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); +char *SHA384_Data(const u_int8_t *, size_t, char *) + __attribute__((__bounded__(__string__,1,2))) + __attribute__((__bounded__(__minbytes__,3,SHA384_DIGEST_STRING_LENGTH))); + +void SHA512_Init(SHA512_CTX *); +void SHA512_Transform(u_int64_t state[8], const u_int8_t [SHA512_BLOCK_LENGTH]); +void SHA512_Update(SHA512_CTX *, const u_int8_t *, size_t) + __attribute__((__bounded__(__string__,2,3))); +void SHA512_Pad(SHA512_CTX *); +void SHA512_Final(u_int8_t [SHA512_DIGEST_LENGTH], SHA512_CTX *) + __attribute__((__bounded__(__minbytes__,1,SHA512_DIGEST_LENGTH))); +char *SHA512_End(SHA512_CTX *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); +char *SHA512_File(const char *, char *) + __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); +char *SHA512_FileChunk(const char *, char *, off_t, off_t) + __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); +char *SHA512_Data(const u_int8_t *, size_t, char *) + __attribute__((__bounded__(__string__,1,2))) + __attribute__((__bounded__(__minbytes__,3,SHA512_DIGEST_STRING_LENGTH))); + +#endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ + +#endif /* _SHA2_H */ diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 74e8a8b13..68ac91192 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,13 +23,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.6 2004/10/06 13:15:44 dtucker Exp $ */ +/* $Id: xmmap.c,v 1.7 2006/03/15 02:02:31 djm Exp $ */ #include "includes.h" +#include #ifdef HAVE_SYS_MMAN_H #include #endif +#include #include "log.h" -- cgit v1.2.3 From 471e9b3ca6500cff8f97f0a472719b01fa3eeb09 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 13:09:18 +1100 Subject: - (djm) [Makefile.in openbsd-compat/Makefile.in] Add added files --- ChangeLog | 3 ++- Makefile.in | 4 ++-- openbsd-compat/Makefile.in | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1664c4fd0..fbdf12179 100644 --- a/ChangeLog +++ b/ChangeLog @@ -248,6 +248,7 @@ KEX support, should work with libc SHA256 support or OpenSSL EVP_sha256 if present - (djm) [includes.h] Restore accidentally dropped netinet/in.h + - (djm) [Makefile.in openbsd-compat/Makefile.in] Add added files 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4149,4 +4150,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4209 2006/03/15 02:07:48 djm Exp $ +$Id: ChangeLog,v 1.4210 2006/03/15 02:09:18 djm Exp $ diff --git a/Makefile.in b/Makefile.in index 1baffb4df..57475f003 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.275 2006/02/19 11:50:20 dtucker Exp $ +# $Id: Makefile.in,v 1.276 2006/03/15 02:09:18 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -66,7 +66,7 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o buffer.o \ canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \ cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ - log.o match.o moduli.o nchan.o packet.o \ + log.o match.o md-sha256.o moduli.o nchan.o packet.o \ readpass.o rsa.o ttymodes.o xmalloc.o \ atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \ diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 3a8703bc1..f1a706241 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.37 2005/12/31 05:33:37 djm Exp $ +# $Id: Makefile.in,v 1.38 2006/03/15 02:09:20 djm Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -16,7 +16,7 @@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ LDFLAGS=-L. @LDFLAGS@ -OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoll.o strtoul.o vis.o +OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoll.o strtoul.o vis.o COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o -- cgit v1.2.3 From a62380786075ece35897bef1ba01386a55f7de33 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 14:02:01 +1100 Subject: - (djm) [openbsd-compat/sha2.h] Avoid include macro clash with system sha2.h --- ChangeLog | 4 +++- openbsd-compat/sha2.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 241961575..d574dc222 100644 --- a/ChangeLog +++ b/ChangeLog @@ -252,6 +252,8 @@ - (djm) [md-sha256.c configure.ac] md-sha256.c needs sha2.h if present - (djm) [regress/.cvsignore] Ignore Makefile here - (djm) [loginrec.c] Need stat.h + - (djm) [openbsd-compat/sha2.h] Avoid include macro clash with + system sha2.h 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4153,4 +4155,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4213 2006/03/15 03:01:11 djm Exp $ +$Id: ChangeLog,v 1.4214 2006/03/15 03:02:01 djm Exp $ diff --git a/openbsd-compat/sha2.h b/openbsd-compat/sha2.h index fb40bde43..5e2641c4b 100644 --- a/openbsd-compat/sha2.h +++ b/openbsd-compat/sha2.h @@ -36,8 +36,8 @@ /* OPENBSD ORIGINAL: include/sha2.h */ -#ifndef _SHA2_H -#define _SHA2_H +#ifndef _SSHSHA2_H +#define _SSHSHA2_H #include "includes.h" @@ -122,4 +122,4 @@ char *SHA512_Data(const u_int8_t *, size_t, char *) #endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ -#endif /* _SHA2_H */ +#endif /* _SSHSHA2_H */ -- cgit v1.2.3 From 34877d2e1744237569555c73afbed02e338218f2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 14:36:55 +1100 Subject: - (djm) [openbsd-compat/sha2.h openbsd-compat/sha2.c] Comment out SHA384, which we don't need and doesn't compile without tweaks --- ChangeLog | 4 +++- openbsd-compat/sha2.c | 2 ++ openbsd-compat/sha2.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 54bfc7c06..d361e71f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -256,6 +256,8 @@ system sha2.h - (djm) [ssh-rand-helper.c] Needs a bunch of headers - (djm) [ssh-agent.c] Restore dropped stat.h + - (djm) [openbsd-compat/sha2.h openbsd-compat/sha2.c] Comment out + SHA384, which we don't need and doesn't compile without tweaks 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4157,4 +4159,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4216 2006/03/15 03:03:06 djm Exp $ +$Id: ChangeLog,v 1.4217 2006/03/15 03:37:48 djm Exp $ diff --git a/openbsd-compat/sha2.c b/openbsd-compat/sha2.c index d04fb25f7..36ab60e62 100644 --- a/openbsd-compat/sha2.c +++ b/openbsd-compat/sha2.c @@ -835,6 +835,7 @@ SHA512_Final(u_int8_t digest[SHA512_DIGEST_LENGTH], SHA512_CTX *context) } +#if 0 /*** SHA-384: *********************************************************/ void SHA384_Init(SHA384_CTX *context) @@ -872,5 +873,6 @@ SHA384_Final(u_int8_t digest[SHA384_DIGEST_LENGTH], SHA384_CTX *context) /* Zero out state data */ memset(context, 0, sizeof(*context)); } +#endif #endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ diff --git a/openbsd-compat/sha2.h b/openbsd-compat/sha2.h index 5e2641c4b..1d6aa61e9 100644 --- a/openbsd-compat/sha2.h +++ b/openbsd-compat/sha2.h @@ -67,7 +67,9 @@ typedef struct _SHA512_CTX { u_int8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; +#if 0 typedef SHA512_CTX SHA384_CTX; +#endif void SHA256_Init(SHA256_CTX *); void SHA256_Transform(u_int32_t state[8], const u_int8_t [SHA256_BLOCK_LENGTH]); @@ -86,6 +88,7 @@ char *SHA256_Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA256_DIGEST_STRING_LENGTH))); +#if 0 void SHA384_Init(SHA384_CTX *); void SHA384_Transform(u_int64_t state[8], const u_int8_t [SHA384_BLOCK_LENGTH]); void SHA384_Update(SHA384_CTX *, const u_int8_t *, size_t) @@ -102,6 +105,7 @@ char *SHA384_FileChunk(const char *, char *, off_t, off_t) char *SHA384_Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA384_DIGEST_STRING_LENGTH))); +#endif /* 0 */ void SHA512_Init(SHA512_CTX *); void SHA512_Transform(u_int64_t state[8], const u_int8_t [SHA512_BLOCK_LENGTH]); -- cgit v1.2.3 From 6645e7a70d1b46b2cb408e1a13755c300a0d47c2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 14:42:54 +1100 Subject: - (djm) [auth-pam.c clientloop.c includes.h monitor.c session.c] [sftp-client.c ssh-keysign.c ssh.c sshconnect.c sshconnect2.c] [sshd.c openbsd-compat/bsd-misc.c openbsd-compat/bsd-openpty.c] [openbsd-compat/glob.c openbsd-compat/mktemp.c] [openbsd-compat/readpassphrase.c] Lots of include fixes for OpenSolaris --- ChangeLog | 8 +++++++- auth-pam.c | 7 ++++++- clientloop.c | 2 ++ includes.h | 1 + monitor.c | 2 ++ openbsd-compat/bsd-misc.c | 5 ++++- openbsd-compat/bsd-openpty.c | 2 ++ openbsd-compat/glob.c | 3 +++ openbsd-compat/mktemp.c | 4 ++++ openbsd-compat/readpassphrase.c | 2 ++ session.c | 2 ++ sftp-client.c | 1 + ssh-keysign.c | 2 ++ ssh.c | 2 ++ sshconnect.c | 2 ++ sshconnect2.c | 1 - sshd.c | 2 ++ 17 files changed, 44 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index d361e71f2..c30c0e399 100644 --- a/ChangeLog +++ b/ChangeLog @@ -258,6 +258,12 @@ - (djm) [ssh-agent.c] Restore dropped stat.h - (djm) [openbsd-compat/sha2.h openbsd-compat/sha2.c] Comment out SHA384, which we don't need and doesn't compile without tweaks + - (djm) [auth-pam.c clientloop.c includes.h monitor.c session.c] + [sftp-client.c ssh-keysign.c ssh.c sshconnect.c sshconnect2.c] + [sshd.c openbsd-compat/bsd-misc.c openbsd-compat/bsd-openpty.c] + [openbsd-compat/glob.c openbsd-compat/mktemp.c] + [openbsd-compat/readpassphrase.c] Lots of include fixes for + OpenSolaris 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4159,4 +4165,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4217 2006/03/15 03:37:48 djm Exp $ +$Id: ChangeLog,v 1.4218 2006/03/15 03:42:54 djm Exp $ diff --git a/auth-pam.c b/auth-pam.c index fb9ae954a..49cf32369 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -47,7 +47,12 @@ /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" -RCSID("$Id: auth-pam.c,v 1.128 2006/01/29 05:46:13 dtucker Exp $"); +RCSID("$Id: auth-pam.c,v 1.129 2006/03/15 03:42:55 djm Exp $"); + +#include +#include +#include +#include #ifdef USE_PAM #if defined(HAVE_SECURITY_PAM_APPL_H) diff --git a/clientloop.c b/clientloop.c index dba3e96c3..83706c297 100644 --- a/clientloop.c +++ b/clientloop.c @@ -68,7 +68,9 @@ RCSID("$OpenBSD: clientloop.c,v 1.155 2006/02/22 00:04:44 stevesk Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include #include diff --git a/includes.h b/includes.h index 800d23e90..431fa2d13 100644 --- a/includes.h +++ b/includes.h @@ -103,6 +103,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } #ifdef HAVE_STDINT_H # include #endif +#include #ifdef HAVE_SYS_BITYPES_H # include /* For u_intXX_t */ #endif diff --git a/monitor.c b/monitor.c index 30849a371..502d54efa 100644 --- a/monitor.c +++ b/monitor.c @@ -30,7 +30,9 @@ RCSID("$OpenBSD: monitor.c,v 1.69 2006/03/07 09:07:40 djm Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include #ifdef SKEY diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index d32b054d7..00482616d 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -16,9 +16,12 @@ */ #include "includes.h" + +#include + #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.28 2005/11/01 22:07:31 dtucker Exp $"); +RCSID("$Id: bsd-misc.c,v 1.29 2006/03/15 03:42:57 djm Exp $"); #ifndef HAVE___PROGNAME char *__progname; diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index 8eb62b7a8..28929de67 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -46,6 +46,8 @@ # include #endif +#include + #ifndef O_NOCTTY #define O_NOCTTY 0 #endif diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index f6a04ea3f..fd3d86c4c 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -34,6 +34,9 @@ /* OPENBSD ORIGINAL: lib/libc/gen/glob.c */ #include "includes.h" +#include +#include +#include #include static long diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 88e04c520..53a50c512 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -35,6 +35,10 @@ #include "includes.h" +#include +#include +#include + #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) static int _gettemp(char *, int *, int, int); diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 919c0174a..95e26dcd4 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -27,6 +27,8 @@ #ifndef HAVE_READPASSPHRASE #include +#include +#include #include #ifdef TCSASOFT diff --git a/session.c b/session.c index 6fb63d3ad..8eb1a03e5 100644 --- a/session.c +++ b/session.c @@ -42,7 +42,9 @@ RCSID("$OpenBSD: session.c,v 1.197 2006/02/28 01:10:21 djm Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include #include "ssh.h" diff --git a/sftp-client.c b/sftp-client.c index 042ab8879..6637feca4 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -26,6 +26,7 @@ RCSID("$OpenBSD: sftp-client.c,v 1.60 2006/02/20 17:19:54 stevesk Exp $"); #ifdef HAVE_SYS_STAT_H # include #endif +# include #include "openbsd-compat/sys-queue.h" diff --git a/ssh-keysign.c b/ssh-keysign.c index f2ee214e1..aa0260bf8 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -24,7 +24,9 @@ #include "includes.h" RCSID("$OpenBSD: ssh-keysign.c,v 1.20 2006/02/08 12:15:27 stevesk Exp $"); +#ifdef HAVE_PATHS_H #include +#endif #include #include diff --git a/ssh.c b/ssh.c index 6f185b4a7..911231a6c 100644 --- a/ssh.c +++ b/ssh.c @@ -51,7 +51,9 @@ RCSID("$OpenBSD: ssh.c,v 1.266 2006/03/12 04:23:07 djm Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include #include diff --git a/sshconnect.c b/sshconnect.c index 9d1c8593c..340270731 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -20,7 +20,9 @@ RCSID("$OpenBSD: sshconnect.c,v 1.176 2006/02/22 00:04:45 stevesk Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include "ssh.h" #include "xmalloc.h" diff --git a/sshconnect2.c b/sshconnect2.c index b01a3ca5b..2467d235c 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -27,7 +27,6 @@ RCSID("$OpenBSD: sshconnect2.c,v 1.147 2006/03/07 09:07:40 djm Exp $"); #include #include -#include #include #include "openbsd-compat/sys-queue.h" diff --git a/sshd.c b/sshd.c index 6f458eb3b..aef4db109 100644 --- a/sshd.c +++ b/sshd.c @@ -51,7 +51,9 @@ RCSID("$OpenBSD: sshd.c,v 1.325 2006/03/13 08:16:00 djm Exp $"); #include #include +#ifdef HAVE_PATHS_H #include +#endif #include #include -- cgit v1.2.3 From 4b23f7c660efee1b4158b6a9fa0197ff9f8f6692 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Tue, 14 Mar 2006 22:09:50 -0800 Subject: - (tim) [openssh/sshpty.c openssh/openbsd-compat/port-tun.c] put in some includes removed from includes.h --- ChangeLog | 5 +++-- openbsd-compat/port-tun.c | 3 +++ sshpty.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index e2bedaad8..c0a0a4ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -265,7 +265,8 @@ [openbsd-compat/readpassphrase.c] Lots of include fixes for OpenSolaris - (tim) [includes.h] put sys/stat.h back in to quiet some "macro redefined:" - warnings. + - (tim) [openssh/sshpty.c openssh/openbsd-compat/port-tun.c] put in some + includes removed from includes.h 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4167,4 +4168,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4219 2006/03/15 05:04:18 tim Exp $ +$Id: ChangeLog,v 1.4220 2006/03/15 06:09:50 tim Exp $ diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index 31921615f..d09fe3d06 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -16,6 +16,9 @@ #include "includes.h" +#include +#include + #include "log.h" #include "misc.h" #include "bufaux.h" diff --git a/sshpty.c b/sshpty.c index 7cfcf91f6..7241580a8 100644 --- a/sshpty.c +++ b/sshpty.c @@ -17,6 +17,7 @@ RCSID("$OpenBSD: sshpty.c,v 1.16 2006/02/20 17:19:54 stevesk Exp $"); #include #include #include +#include #ifdef HAVE_PATHS_H # include -- cgit v1.2.3 From dc6118e1272e91fd4faebde7b2ea85a36dd6f08d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 15 Mar 2006 22:25:54 +1100 Subject: - (dtucker) [openbsd-compat/openbsd-compat.h] AIX (at least) needs sys/ioctl.h for struct winsize. --- ChangeLog | 4 +++- openbsd-compat/openbsd-compat.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 5a6923b04..339568ddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -269,6 +269,8 @@ includes removed from includes.h - (dtucker) [configure.ac] Fix glob test conversion to AC_TRY_COMPILE - (djm) [includes.h] Put back paths.h, it is needed in defines.h + - (dtucker) [openbsd-compat/openbsd-compat.h] AIX (at least) needs + sys/ioctl.h for struct winsize. 20060313 - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) @@ -4170,4 +4172,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4222 2006/03/15 10:48:54 djm Exp $ +$Id: ChangeLog,v 1.4223 2006/03/15 11:25:54 dtucker Exp $ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 9022c793f..432b183e7 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.34 2006/03/15 02:02:31 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.35 2006/03/15 11:25:55 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -147,6 +147,7 @@ int asprintf(char **, const char *, ...); #endif #ifndef HAVE_OPENPTY +# include /* for struct winsize */ int openpty(int *, int *, char *, struct termios *, struct winsize *); #endif /* HAVE_OPENPTY */ -- cgit v1.2.3 From 425a6886f99235e61faf8ea67c8f573f188eb2b2 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Wed, 15 Mar 2006 20:17:05 -0800 Subject: - (tim) [kex.c myproposal.h md-sha256.c openbsd-compat/sha2.c,h] Disable sha256 when openssl < 0.9.7. Patch from djm@. Corrections/testing by me. --- ChangeLog | 4 +++- kex.c | 8 +++++--- md-sha256.c | 5 +++-- myproposal.h | 14 +++++++++++++- openbsd-compat/sha2.c | 8 ++++++-- openbsd-compat/sha2.h | 8 ++++++-- 6 files changed, 36 insertions(+), 11 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1c4fdef89..aa2918414 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - (dtucker) [entropy.c] Add headers for WIFEXITED and friends. - (dtucker) [configure.ac md-sha256.c] NetBSD has sha2.h in /usr/include/crypto. Hint from djm@. + - (tim) [kex.c myproposal.h md-sha256.c openbsd-compat/sha2.c,h] + Disable sha256 when openssl < 0.9.7. Patch from djm@. 20060315 - (djm) OpenBSD CVS Sync: @@ -4178,4 +4180,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4226 2006/03/15 21:14:34 dtucker Exp $ +$Id: ChangeLog,v 1.4227 2006/03/16 04:17:05 tim Exp $ diff --git a/kex.c b/kex.c index 70c2c9709..8610a7dab 100644 --- a/kex.c +++ b/kex.c @@ -44,11 +44,13 @@ RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $"); #define KEX_COOKIE_LEN 16 -#ifdef HAVE_EVP_SHA256 +#if OPENSSL_VERSION_NUMBER < 0x00907000L +# define evp_ssh_sha256() NULL +#elif defined(HAVE_EVP_SHA256) # define evp_ssh_sha256 EVP_sha256 -#else /* HAVE_EVP_SHA256 */ +#else extern const EVP_MD *evp_ssh_sha256(void); -#endif /* HAVE_EVP_SHA256 */ +#endif /* prototype */ static void kex_kexinit_finish(Kex *); diff --git a/md-sha256.c b/md-sha256.c index 0b1ed5828..064228a4a 100644 --- a/md-sha256.c +++ b/md-sha256.c @@ -17,8 +17,9 @@ /* EVP wrapper for SHA256 */ #include "includes.h" +#include -#ifndef HAVE_EVP_SHA256 +#if !defined(HAVE_EVP_SHA256) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) #include #include @@ -80,5 +81,5 @@ evp_ssh_sha256(void) return (&ssh_sha256); } -#endif /* HAVE_EVP_SHA256 */ +#endif /* !defined(HAVE_EVP_SHA256) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) */ diff --git a/myproposal.h b/myproposal.h index cc94a8ed2..43c540209 100644 --- a/myproposal.h +++ b/myproposal.h @@ -23,11 +23,23 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define KEX_DEFAULT_KEX \ + +#include + +/* Old OpenSSL doesn't support what we need for DHGEX-sha256 */ +#if OPENSSL_VERSION_NUMBER < 0x00907000L +# define KEX_DEFAULT_KEX \ + "diffie-hellman-group-exchange-sha1," \ + "diffie-hellman-group14-sha1," \ + "diffie-hellman-group1-sha1" +#else +# define KEX_DEFAULT_KEX \ "diffie-hellman-group-exchange-sha256," \ "diffie-hellman-group-exchange-sha1," \ "diffie-hellman-group14-sha1," \ "diffie-hellman-group1-sha1" +#endif + #define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss" #define KEX_DEFAULT_ENCRYPT \ "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ diff --git a/openbsd-compat/sha2.c b/openbsd-compat/sha2.c index 36ab60e62..cf8e0ad66 100644 --- a/openbsd-compat/sha2.c +++ b/openbsd-compat/sha2.c @@ -38,7 +38,10 @@ #include "includes.h" -#if !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) +#include + +#if !defined(HAVE_EVP_SHA256) && !defined(HAVE_SHA256_UPDATE) && \ + (OPENSSL_VERSION_NUMBER >= 0x00907000L) #include #include #include "sha2.h" @@ -875,4 +878,5 @@ SHA384_Final(u_int8_t digest[SHA384_DIGEST_LENGTH], SHA384_CTX *context) } #endif -#endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ +#endif /* !defined(HAVE_EVP_SHA256) && !defined(HAVE_SHA256_UPDATE) && \ + (OPENSSL_VERSION_NUMBER >= 0x00907000L) */ diff --git a/openbsd-compat/sha2.h b/openbsd-compat/sha2.h index 1d6aa61e9..821f2dd6c 100644 --- a/openbsd-compat/sha2.h +++ b/openbsd-compat/sha2.h @@ -41,7 +41,10 @@ #include "includes.h" -#if !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) +#include + +#if !defined(HAVE_EVP_SHA256) && !defined(HAVE_SHA256_UPDATE) && \ + (OPENSSL_VERSION_NUMBER >= 0x00907000L) /*** SHA-256/384/512 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 @@ -124,6 +127,7 @@ char *SHA512_Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA512_DIGEST_STRING_LENGTH))); -#endif /* !defined(HAVE_SHA256_UPDATE) && !defined(HAVE_EVP_SHA256) */ +#endif /* !defined(HAVE_EVP_SHA256) && !defined(HAVE_SHA256_UPDATE) && \ + (OPENSSL_VERSION_NUMBER >= 0x00907000L) */ #endif /* _SSHSHA2_H */ -- cgit v1.2.3 From 9834cab32ef1abd8f0e4e74852ac52c35cfce0ef Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 19 Mar 2006 00:07:07 +1100 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Bug #1173: make fmtint() take a LLONG rather than a long. Fixes scp'ing of large files on platforms with missing/broken snprintfs. Patch from e.borovac at bom.gov.au. --- ChangeLog | 9 ++++++--- openbsd-compat/bsd-snprintf.c | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 61bf3b852..342844d33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 20060318 -- (djm) [auth-pam.c] Fix memleak in error path, from Coverity via - elad AT NetBSD.org + - (djm) [auth-pam.c] Fix memleak in error path, from Coverity via + elad AT NetBSD.org + - (dtucker) [openbsd-compat/bsd-snprintf.c] Bug #1173: make fmtint() take + a LLONG rather than a long. Fixes scp'ing of large files on platforms + with missing/broken snprintfs. Patch from e.borovac at bom.gov.au. 20060316 - (dtucker) [entropy.c] Add headers for WIFEXITED and friends. @@ -4186,4 +4189,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4229 2006/03/18 12:04:49 djm Exp $ +$Id: ChangeLog,v 1.4230 2006/03/18 13:07:07 dtucker Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index e4ba154fd..571c61fc0 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -89,7 +89,7 @@ #include "includes.h" -RCSID("$Id: bsd-snprintf.c,v 1.11 2005/12/17 11:32:04 dtucker Exp $"); +RCSID("$Id: bsd-snprintf.c,v 1.12 2006/03/18 13:07:07 dtucker Exp $"); #if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ # undef HAVE_SNPRINTF @@ -161,7 +161,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max); static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags); + LLONG value, int base, int min, int max, int flags); static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags); static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); @@ -468,10 +468,10 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags) + LLONG value, int base, int min, int max, int flags) { int signvalue = 0; - unsigned long uvalue; + unsigned LLONG uvalue; char convert[20]; int place = 0; int spadlen = 0; /* amount to space pad */ -- cgit v1.2.3 From b0fb6872ed2efe3a116083e43dd4f5f47cd4882b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 26 Mar 2006 00:03:21 +1100 Subject: - deraadt@cvs.openbsd.org 2006/03/19 18:51:18 [atomicio.c auth-bsdauth.c auth-chall.c auth-krb5.c auth-options.c] [auth-pam.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c] [auth-shadow.c auth-skey.c auth.c auth1.c auth2-chall.c] [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c] [auth2-pubkey.c auth2.c authfd.c authfile.c bufaux.c buffer.c] [canohost.c channels.c cipher-3des1.c cipher-acss.c cipher-aes.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 entropy.c fatal.c] [groupaccess.c hostfile.c includes.h kex.c kexdh.c kexdhc.c] [kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c log.c loginrec.c] [loginrec.h logintest.c mac.c match.c md-sha256.c md5crypt.c misc.c] [monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c msg.c] [nchan.c packet.c progressmeter.c readconf.c readpass.c rsa.c] [scard.c scp.c servconf.c serverloop.c session.c sftp-client.c] [sftp-common.c sftp-glob.c sftp-server.c sftp.c ssh-add.c] [ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] [ssh-rand-helper.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c] [sshconnect2.c sshd.c sshlogin.c sshpty.c sshtty.c ttymodes.c] [uidswap.c uuencode.c xmalloc.c openbsd-compat/bsd-arc4random.c] [openbsd-compat/bsd-closefrom.c openbsd-compat/bsd-cygwin_util.c] [openbsd-compat/bsd-getpeereid.c openbsd-compat/bsd-misc.c] [openbsd-compat/bsd-nextstep.c openbsd-compat/bsd-snprintf.c] [openbsd-compat/bsd-waitpid.c openbsd-compat/fake-rfc2553.c] RCSID() can die --- ChangeLog | 27 ++++++++++++++++++++++++++- atomicio.c | 1 - auth-bsdauth.c | 1 - auth-chall.c | 1 - auth-krb5.c | 1 - auth-options.c | 1 - auth-pam.c | 1 - auth-passwd.c | 1 - auth-rh-rsa.c | 1 - auth-rhosts.c | 1 - auth-rsa.c | 1 - auth-shadow.c | 1 - auth-skey.c | 1 - auth.c | 1 - auth1.c | 1 - auth2-chall.c | 1 - auth2-hostbased.c | 1 - auth2-kbdint.c | 1 - auth2-none.c | 1 - auth2-passwd.c | 1 - auth2-pubkey.c | 1 - auth2.c | 1 - authfd.c | 1 - authfile.c | 1 - bufaux.c | 1 - buffer.c | 1 - canohost.c | 1 - channels.c | 1 - cipher-3des1.c | 1 - cipher-acss.c | 2 -- cipher-aes.c | 1 - cipher-bf1.c | 1 - cipher-ctr.c | 1 - cipher.c | 1 - cleanup.c | 1 - clientloop.c | 1 - compat.c | 1 - compress.c | 1 - deattack.c | 1 - dh.c | 1 - dispatch.c | 1 - dns.c | 3 +-- entropy.c | 2 -- fatal.c | 1 - groupaccess.c | 1 - hostfile.c | 1 - includes.h | 5 +---- kex.c | 1 - kexdh.c | 1 - kexdhc.c | 1 - kexdhs.c | 1 - kexgex.c | 1 - kexgexc.c | 1 - kexgexs.c | 1 - key.c | 1 - log.c | 1 - loginrec.c | 2 -- loginrec.h | 2 -- logintest.c | 2 -- mac.c | 1 - match.c | 1 - md-sha256.c | 2 -- md5crypt.c | 2 -- misc.c | 1 - monitor.c | 1 - monitor_fdpass.c | 1 - monitor_mm.c | 1 - monitor_wrap.c | 1 - msg.c | 1 - nchan.c | 1 - openbsd-compat/bsd-arc4random.c | 2 -- openbsd-compat/bsd-closefrom.c | 2 -- openbsd-compat/bsd-cygwin_util.c | 2 -- openbsd-compat/bsd-getpeereid.c | 2 -- openbsd-compat/bsd-misc.c | 2 -- openbsd-compat/bsd-nextstep.c | 2 -- openbsd-compat/bsd-snprintf.c | 2 -- openbsd-compat/bsd-waitpid.c | 2 -- openbsd-compat/fake-rfc2553.c | 2 -- packet.c | 1 - progressmeter.c | 1 - readconf.c | 1 - readpass.c | 1 - rsa.c | 1 - scard.c | 1 - scp.c | 1 - servconf.c | 1 - serverloop.c | 1 - session.c | 1 - sftp-client.c | 1 - sftp-common.c | 1 - sftp-glob.c | 1 - sftp-server.c | 1 - sftp.c | 1 - ssh-add.c | 1 - ssh-agent.c | 1 - ssh-dss.c | 1 - ssh-keygen.c | 1 - ssh-keyscan.c | 1 - ssh-keysign.c | 1 - ssh-rand-helper.c | 2 -- ssh-rsa.c | 1 - ssh.c | 1 - sshconnect.c | 1 - sshconnect1.c | 1 - sshconnect2.c | 1 - sshd.c | 1 - sshlogin.c | 1 - sshpty.c | 1 - sshtty.c | 1 - ttymodes.c | 1 - uidswap.c | 1 - uuencode.c | 1 - xmalloc.c | 1 - 114 files changed, 28 insertions(+), 135 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 2281accdc..64a20a4c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,31 @@ [ssh.1] Add RFC4419 (Diffie-Hellman group exchange KEX) to the list of SSH RFCs that OpenSSH supports + - deraadt@cvs.openbsd.org 2006/03/19 18:51:18 + [atomicio.c auth-bsdauth.c auth-chall.c auth-krb5.c auth-options.c] + [auth-pam.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c auth-rsa.c] + [auth-shadow.c auth-skey.c auth.c auth1.c auth2-chall.c] + [auth2-hostbased.c auth2-kbdint.c auth2-none.c auth2-passwd.c] + [auth2-pubkey.c auth2.c authfd.c authfile.c bufaux.c buffer.c] + [canohost.c channels.c cipher-3des1.c cipher-acss.c cipher-aes.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 entropy.c fatal.c] + [groupaccess.c hostfile.c includes.h kex.c kexdh.c kexdhc.c] + [kexdhs.c kexgex.c kexgexc.c kexgexs.c key.c log.c loginrec.c] + [loginrec.h logintest.c mac.c match.c md-sha256.c md5crypt.c misc.c] + [monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c msg.c] + [nchan.c packet.c progressmeter.c readconf.c readpass.c rsa.c] + [scard.c scp.c servconf.c serverloop.c session.c sftp-client.c] + [sftp-common.c sftp-glob.c sftp-server.c sftp.c ssh-add.c] + [ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] + [ssh-rand-helper.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c] + [sshconnect2.c sshd.c sshlogin.c sshpty.c sshtty.c ttymodes.c] + [uidswap.c uuencode.c xmalloc.c openbsd-compat/bsd-arc4random.c] + [openbsd-compat/bsd-closefrom.c openbsd-compat/bsd-cygwin_util.c] + [openbsd-compat/bsd-getpeereid.c openbsd-compat/bsd-misc.c] + [openbsd-compat/bsd-nextstep.c openbsd-compat/bsd-snprintf.c] + [openbsd-compat/bsd-waitpid.c openbsd-compat/fake-rfc2553.c] + RCSID() can die 20060318 - (djm) [auth-pam.c] Fix memleak in error path, from Coverity via @@ -4196,4 +4221,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4231 2006/03/25 12:39:29 djm Exp $ +$Id: ChangeLog,v 1.4232 2006/03/25 13:03:21 djm Exp $ diff --git a/atomicio.c b/atomicio.c index 8dd271b6d..afe306b1b 100644 --- a/atomicio.c +++ b/atomicio.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: atomicio.c,v 1.14 2006/02/11 19:31:18 otto Exp $"); #include "atomicio.h" diff --git a/auth-bsdauth.c b/auth-bsdauth.c index 920c977d8..f48b43174 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-bsdauth.c,v 1.6 2005/01/19 13:11:47 dtucker Exp $"); #ifdef BSD_AUTH #include "xmalloc.h" diff --git a/auth-chall.c b/auth-chall.c index e4f783096..7707023a4 100644 --- a/auth-chall.c +++ b/auth-chall.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-chall.c,v 1.9 2003/11/03 09:03:37 djm Exp $"); #include "auth.h" #include "log.h" diff --git a/auth-krb5.c b/auth-krb5.c index 64d613543..8bdc64edf 100644 --- a/auth-krb5.c +++ b/auth-krb5.c @@ -28,7 +28,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-krb5.c,v 1.16 2005/11/21 09:42:10 dtucker Exp $"); #include "ssh.h" #include "ssh1.h" diff --git a/auth-options.c b/auth-options.c index ad97e6129..77488a49d 100644 --- a/auth-options.c +++ b/auth-options.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-options.c,v 1.33 2005/12/08 18:34:11 reyk Exp $"); #include "xmalloc.h" #include "match.h" diff --git a/auth-pam.c b/auth-pam.c index 2d975c394..3d64de76a 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -47,7 +47,6 @@ /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" -RCSID("$Id: auth-pam.c,v 1.130 2006/03/18 12:04:49 djm Exp $"); #include #include diff --git a/auth-passwd.c b/auth-passwd.c index 6e6d0d76a..df202dde3 100644 --- a/auth-passwd.c +++ b/auth-passwd.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-passwd.c,v 1.34 2005/07/19 15:32:26 otto Exp $"); #include "packet.h" #include "buffer.h" diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c index c31f2b97b..f9c386dba 100644 --- a/auth-rh-rsa.c +++ b/auth-rh-rsa.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rh-rsa.c,v 1.38 2005/07/17 07:17:54 djm Exp $"); #include "packet.h" #include "uidswap.h" diff --git a/auth-rhosts.c b/auth-rhosts.c index 1deeb30b9..098893563 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c @@ -14,7 +14,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rhosts.c,v 1.35 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth-rsa.c b/auth-rsa.c index 275c0b67b..effff5d2a 100644 --- a/auth-rsa.c +++ b/auth-rsa.c @@ -14,7 +14,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.64 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth-shadow.c b/auth-shadow.c index 59737b93c..c8d5dd3c1 100644 --- a/auth-shadow.c +++ b/auth-shadow.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$Id: auth-shadow.c,v 1.7 2005/07/17 07:04:47 djm Exp $"); #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) #include diff --git a/auth-skey.c b/auth-skey.c index f676dbec9..ce8c1a809 100644 --- a/auth-skey.c +++ b/auth-skey.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $"); #ifdef SKEY diff --git a/auth.c b/auth.c index fca373b80..35bc5ea1d 100644 --- a/auth.c +++ b/auth.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth.c,v 1.62 2006/02/20 17:19:53 stevesk Exp $"); #include #include diff --git a/auth1.c b/auth1.c index 4bc2bf76d..cc1092abf 100644 --- a/auth1.c +++ b/auth1.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.62 2005/07/16 01:35:24 djm Exp $"); #include "xmalloc.h" #include "rsa.h" diff --git a/auth2-chall.c b/auth2-chall.c index b147cadf3..8860a94c5 100644 --- a/auth2-chall.c +++ b/auth2-chall.c @@ -23,7 +23,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth2-chall.c,v 1.24 2005/07/17 07:17:54 djm Exp $"); #include "ssh2.h" #include "auth.h" diff --git a/auth2-hostbased.c b/auth2-hostbased.c index 1111ed67a..251828496 100644 --- a/auth2-hostbased.c +++ b/auth2-hostbased.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-hostbased.c,v 1.6 2004/01/19 21:25:15 markus Exp $"); #include "ssh2.h" #include "xmalloc.h" diff --git a/auth2-kbdint.c b/auth2-kbdint.c index fa8364975..1b902e4cb 100644 --- a/auth2-kbdint.c +++ b/auth2-kbdint.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-kbdint.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); #include "packet.h" #include "auth.h" diff --git a/auth2-none.c b/auth2-none.c index 2eb27a914..19cc2b1b7 100644 --- a/auth2-none.c +++ b/auth2-none.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-none.c,v 1.8 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/auth2-passwd.c b/auth2-passwd.c index 2321ef47b..41507af1d 100644 --- a/auth2-passwd.c +++ b/auth2-passwd.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-passwd.c,v 1.5 2003/12/31 00:24:50 dtucker Exp $"); #include "xmalloc.h" #include "packet.h" diff --git a/auth2-pubkey.c b/auth2-pubkey.c index ea1367070..a59c37993 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-pubkey.c,v 1.10 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/auth2.c b/auth2.c index d255242ed..b49cc79c7 100644 --- a/auth2.c +++ b/auth2.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2.c,v 1.107 2004/07/28 09:40:29 markus Exp $"); #include "ssh2.h" #include "xmalloc.h" diff --git a/authfd.c b/authfd.c index 06e6d4a4c..a3f22cfc7 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.67 2006/02/20 16:36:14 stevesk Exp $"); #include #include diff --git a/authfile.c b/authfile.c index 0656262d0..d529c8340 100644 --- a/authfile.c +++ b/authfile.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfile.c,v 1.63 2006/03/13 10:26:52 dtucker Exp $"); #include #include diff --git a/bufaux.c b/bufaux.c index 106a3a0c7..19f6708f0 100644 --- a/bufaux.c +++ b/bufaux.c @@ -37,7 +37,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.37 2005/11/05 05:01:15 djm Exp $"); #include #include "bufaux.h" diff --git a/buffer.c b/buffer.c index 487e08105..08682e0f1 100644 --- a/buffer.c +++ b/buffer.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: buffer.c,v 1.23 2005/03/14 11:46:56 markus Exp $"); #include "xmalloc.h" #include "buffer.h" diff --git a/canohost.c b/canohost.c index f15aecb62..4fafb0b82 100644 --- a/canohost.c +++ b/canohost.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: canohost.c,v 1.50 2006/03/14 00:15:39 djm Exp $"); #include diff --git a/channels.c b/channels.c index 7161b9413..30c6d3870 100644 --- a/channels.c +++ b/channels.c @@ -39,7 +39,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.235 2006/02/20 16:36:14 stevesk Exp $"); #include #include diff --git a/cipher-3des1.c b/cipher-3des1.c index f815e8ae5..53b5a2958 100644 --- a/cipher-3des1.c +++ b/cipher-3des1.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher-3des1.c,v 1.2 2003/12/22 20:29:55 markus Exp $"); #include #include "xmalloc.h" diff --git a/cipher-acss.c b/cipher-acss.c index a95fa6747..90b51a4d1 100644 --- a/cipher-acss.c +++ b/cipher-acss.c @@ -17,8 +17,6 @@ #include "includes.h" #include -RCSID("$Id: cipher-acss.c,v 1.3 2005/07/17 07:04:47 djm Exp $"); - #if !defined(EVP_CTRL_SET_ACSS_MODE) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) #include "acss.h" diff --git a/cipher-aes.c b/cipher-aes.c index 228ddb104..99e9eea92 100644 --- a/cipher-aes.c +++ b/cipher-aes.c @@ -28,7 +28,6 @@ #include "openbsd-compat/openssl-compat.h" #ifdef USE_BUILTIN_RIJNDAEL -RCSID("$OpenBSD: cipher-aes.c,v 1.2 2003/11/26 21:44:29 djm Exp $"); #include #include "rijndael.h" diff --git a/cipher-bf1.c b/cipher-bf1.c index 5af695c17..e7246650b 100644 --- a/cipher-bf1.c +++ b/cipher-bf1.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher-bf1.c,v 1.1 2003/05/15 03:08:29 markus Exp $"); #include #include "xmalloc.h" diff --git a/cipher-ctr.c b/cipher-ctr.c index 8a98f3c42..9615f5aa6 100644 --- a/cipher-ctr.c +++ b/cipher-ctr.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: cipher-ctr.c,v 1.6 2005/07/17 07:17:55 djm Exp $"); #include diff --git a/cipher.c b/cipher.c index 1434d5524..15397db03 100644 --- a/cipher.c +++ b/cipher.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.77 2005/07/16 01:35:24 djm Exp $"); #include "xmalloc.h" #include "log.h" diff --git a/cleanup.c b/cleanup.c index 11d1d4d9a..7b40ca781 100644 --- a/cleanup.c +++ b/cleanup.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: cleanup.c,v 1.1 2003/09/23 20:17:11 markus Exp $"); #include "log.h" diff --git a/clientloop.c b/clientloop.c index 83706c297..6d58a5afb 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.155 2006/02/22 00:04:44 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/compat.c b/compat.c index 4086e853e..24d9a7f38 100644 --- a/compat.c +++ b/compat.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: compat.c,v 1.71 2005/03/01 10:09:52 djm Exp $"); #include "buffer.h" #include "packet.h" diff --git a/compress.c b/compress.c index 0d1c7e55e..6f8d6b775 100644 --- a/compress.c +++ b/compress.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: compress.c,v 1.21 2004/01/13 19:45:15 markus Exp $"); #include "log.h" #include "buffer.h" diff --git a/deattack.c b/deattack.c index 0cf1e1c54..3d48afc89 100644 --- a/deattack.c +++ b/deattack.c @@ -18,7 +18,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: deattack.c,v 1.20 2006/02/07 03:59:20 stevesk Exp $"); #include "deattack.h" #include "log.h" diff --git a/dh.c b/dh.c index 044d869fb..a30b704fb 100644 --- a/dh.c +++ b/dh.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: dh.c,v 1.31 2004/08/04 10:37:52 djm Exp $"); #include "xmalloc.h" diff --git a/dispatch.c b/dispatch.c index c5ff65031..3f96c726b 100644 --- a/dispatch.c +++ b/dispatch.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: dispatch.c,v 1.16 2003/04/08 20:21:28 itojun Exp $"); #include "ssh1.h" #include "ssh2.h" diff --git a/dns.c b/dns.c index a71dd9bff..e9270798d 100644 --- a/dns.c +++ b/dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dns.c,v 1.16 2005/10/17 14:13:35 stevesk Exp $ */ +/* $OpenBSD: dns.c,v 1.17 2006/03/19 18:51:18 deraadt Exp $ */ /* * Copyright (c) 2003 Wesley Griffin. All rights reserved. @@ -26,7 +26,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: dns.c,v 1.16 2005/10/17 14:13:35 stevesk Exp $"); #include diff --git a/entropy.c b/entropy.c index 91724273e..d60583b34 100644 --- a/entropy.c +++ b/entropy.c @@ -51,8 +51,6 @@ * XXX: we should tell the child how many bytes we need. */ -RCSID("$Id: entropy.c,v 1.53 2006/03/15 20:21:35 dtucker Exp $"); - #ifndef OPENSSL_PRNG_ONLY #define RANDOM_SEED_SIZE 48 static uid_t original_uid, original_euid; diff --git a/fatal.c b/fatal.c index ae1aaac6e..8eea85a03 100644 --- a/fatal.c +++ b/fatal.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: fatal.c,v 1.2 2003/09/23 20:17:11 markus Exp $"); #include "log.h" diff --git a/groupaccess.c b/groupaccess.c index f50879f83..2328bf453 100644 --- a/groupaccess.c +++ b/groupaccess.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: groupaccess.c,v 1.6 2003/04/08 20:21:28 itojun Exp $"); #include "groupaccess.h" #include "xmalloc.h" diff --git a/hostfile.c b/hostfile.c index 5cb55dd3c..85fbcf7ce 100644 --- a/hostfile.c +++ b/hostfile.c @@ -36,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.37 2006/02/07 03:47:05 stevesk Exp $"); #include diff --git a/includes.h b/includes.h index 65c34c496..363be3ac5 100644 --- a/includes.h +++ b/includes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: includes.h,v 1.37 2006/02/22 00:04:44 stevesk Exp $ */ +/* $OpenBSD: includes.h,v 1.38 2006/03/19 18:51:18 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -16,9 +16,6 @@ #ifndef INCLUDES_H #define INCLUDES_H -#define RCSID(msg) \ -static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } - #include "config.h" #define _GNU_SOURCE /* activate extra prototypes for glibc */ diff --git a/kex.c b/kex.c index 23d8d2923..ced56e668 100644 --- a/kex.c +++ b/kex.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $"); #include diff --git a/kexdh.c b/kexdh.c index f79d8781d..f34214062 100644 --- a/kexdh.c +++ b/kexdh.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.20 2005/11/04 05:15:59 djm Exp $"); #include diff --git a/kexdhc.c b/kexdhc.c index d8a2fa3b7..23abeb50d 100644 --- a/kexdhc.c +++ b/kexdhc.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdhc.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexdhs.c b/kexdhs.c index 26c8cdfd6..be815e46b 100644 --- a/kexdhs.c +++ b/kexdhs.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdhs.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexgex.c b/kexgex.c index 705484a47..b306821cc 100644 --- a/kexgex.c +++ b/kexgex.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgex.c,v 1.24 2005/11/04 05:15:59 djm Exp $"); #include diff --git a/kexgexc.c b/kexgexc.c index a6ff8757d..50c5a32e5 100644 --- a/kexgexc.c +++ b/kexgexc.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgexc.c,v 1.3 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/kexgexs.c b/kexgexs.c index c48b27af9..e3d0eacc5 100644 --- a/kexgexs.c +++ b/kexgexs.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgexs.c,v 1.2 2005/11/04 05:15:59 djm Exp $"); #include "xmalloc.h" #include "key.h" diff --git a/key.c b/key.c index 08c158b59..5cb54c13b 100644 --- a/key.c +++ b/key.c @@ -32,7 +32,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.58 2005/06/17 02:44:32 djm Exp $"); #include diff --git a/log.c b/log.c index 96ab24b04..58ba8591c 100644 --- a/log.c +++ b/log.c @@ -34,7 +34,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: log.c,v 1.29 2003/09/23 20:17:11 markus Exp $"); #include "log.h" #include "xmalloc.h" diff --git a/loginrec.c b/loginrec.c index 9f9eb69a7..c2498e1e3 100644 --- a/loginrec.c +++ b/loginrec.c @@ -168,8 +168,6 @@ # include #endif -RCSID("$Id: loginrec.c,v 1.72 2006/03/15 03:01:11 djm Exp $"); - /** ** prototypes for helper functions in this file **/ diff --git a/loginrec.h b/loginrec.h index 8e3390178..4fe24ac2a 100644 --- a/loginrec.h +++ b/loginrec.h @@ -35,8 +35,6 @@ #include #include -/* RCSID("$Id: loginrec.h,v 1.10 2005/06/19 00:19:44 djm Exp $"); */ - /** ** you should use the login_* calls to work around platform dependencies **/ diff --git a/logintest.c b/logintest.c index 95cce5a3a..1159274f8 100644 --- a/logintest.c +++ b/logintest.c @@ -43,8 +43,6 @@ #include "loginrec.h" -RCSID("$Id: logintest.c,v 1.11 2004/07/17 04:07:42 dtucker Exp $"); - extern char *__progname; #define PAUSE_BEFORE_LOGOUT 3 diff --git a/mac.c b/mac.c index 2bda5a1b9..f03100ac9 100644 --- a/mac.c +++ b/mac.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: mac.c,v 1.7 2005/06/17 02:44:32 djm Exp $"); #include diff --git a/match.c b/match.c index 51407b818..736047df1 100644 --- a/match.c +++ b/match.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: match.c,v 1.21 2006/02/22 00:04:44 stevesk Exp $"); #include diff --git a/md-sha256.c b/md-sha256.c index 064228a4a..8ea0ac433 100644 --- a/md-sha256.c +++ b/md-sha256.c @@ -31,8 +31,6 @@ # endif #endif -RCSID("$OpenBSD: md-sha256.c,v 1.1 2006/03/07 09:07:40 djm Exp $"); - const EVP_MD *evp_ssh_sha256(void); static int diff --git a/md5crypt.c b/md5crypt.c index 8f2523e62..253fdfdf2 100644 --- a/md5crypt.c +++ b/md5crypt.c @@ -13,8 +13,6 @@ #if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) #include -RCSID("$Id: md5crypt.c,v 1.9 2003/11/21 12:56:47 djm Exp $"); - /* 0 ... 63 => ascii - 64 */ static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; diff --git a/misc.c b/misc.c index 662480e9e..66b762b5a 100644 --- a/misc.c +++ b/misc.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: misc.c,v 1.46 2006/03/13 10:14:29 dtucker Exp $"); #include #include diff --git a/monitor.c b/monitor.c index 502d54efa..e34d006d7 100644 --- a/monitor.c +++ b/monitor.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.69 2006/03/07 09:07:40 djm Exp $"); #include #include diff --git a/monitor_fdpass.c b/monitor_fdpass.c index dd1a13984..dec90d18b 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_fdpass.c,v 1.6 2004/08/13 02:51:48 djm Exp $"); #include diff --git a/monitor_mm.c b/monitor_mm.c index b0ec37cff..e8de71fea 100644 --- a/monitor_mm.c +++ b/monitor_mm.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_mm.c,v 1.9 2004/05/11 19:01:43 deraadt Exp $"); #ifdef HAVE_SYS_MMAN_H #include diff --git a/monitor_wrap.c b/monitor_wrap.c index 3b50753de..7536bf305 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -25,7 +25,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.40 2005/05/24 17:32:43 avsm Exp $"); #include #include diff --git a/msg.c b/msg.c index 3e4c2882c..662db4cdb 100644 --- a/msg.c +++ b/msg.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.8 2005/05/24 17:32:43 avsm Exp $"); #include "buffer.h" #include "getput.h" diff --git a/nchan.c b/nchan.c index aee3f37b0..ca9a56b59 100644 --- a/nchan.c +++ b/nchan.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: nchan.c,v 1.51 2004/07/11 17:48:47 deraadt Exp $"); #include "ssh1.h" #include "ssh2.h" diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c index 1eeb6953b..46e0a020f 100644 --- a/openbsd-compat/bsd-arc4random.c +++ b/openbsd-compat/bsd-arc4random.c @@ -17,8 +17,6 @@ #include "includes.h" #include "log.h" -RCSID("$Id: bsd-arc4random.c,v 1.10 2005/02/16 02:01:28 djm Exp $"); - #ifndef HAVE_ARC4RANDOM #include diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 5b7b94ae4..7509d2835 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -46,8 +46,6 @@ # define OPEN_MAX 256 #endif -RCSID("$Id: bsd-closefrom.c,v 1.2 2005/11/10 08:29:13 dtucker Exp $"); - #ifndef lint static const char sudorcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $"; #endif /* lint */ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 96be7fecd..8f3acee26 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -29,8 +29,6 @@ #include "includes.h" -RCSID("$Id: bsd-cygwin_util.c,v 1.15 2006/02/12 00:59:09 dtucker Exp $"); - #ifdef HAVE_CYGWIN #include diff --git a/openbsd-compat/bsd-getpeereid.c b/openbsd-compat/bsd-getpeereid.c index fe2edad71..d94489d1d 100644 --- a/openbsd-compat/bsd-getpeereid.c +++ b/openbsd-compat/bsd-getpeereid.c @@ -16,8 +16,6 @@ #include "includes.h" -RCSID("$Id: bsd-getpeereid.c,v 1.3 2004/02/17 05:49:55 djm Exp $"); - #if !defined(HAVE_GETPEEREID) #if defined(SO_PEERCRED) diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 00482616d..d2d9ad771 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -21,8 +21,6 @@ #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.29 2006/03/15 03:42:57 djm Exp $"); - #ifndef HAVE___PROGNAME char *__progname; #endif diff --git a/openbsd-compat/bsd-nextstep.c b/openbsd-compat/bsd-nextstep.c index bd35a3afc..8195af88a 100644 --- a/openbsd-compat/bsd-nextstep.c +++ b/openbsd-compat/bsd-nextstep.c @@ -24,8 +24,6 @@ #include "includes.h" -RCSID("$Id: bsd-nextstep.c,v 1.6 2003/06/01 03:23:57 mouring Exp $"); - #ifdef HAVE_NEXT #include #include diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 571c61fc0..c30cd1223 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -89,8 +89,6 @@ #include "includes.h" -RCSID("$Id: bsd-snprintf.c,v 1.12 2006/03/18 13:07:07 dtucker Exp $"); - #if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ # undef HAVE_SNPRINTF # undef HAVE_VSNPRINTF diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c index 93c9ec35e..40e6ffaa8 100644 --- a/openbsd-compat/bsd-waitpid.c +++ b/openbsd-compat/bsd-waitpid.c @@ -24,8 +24,6 @@ #include "includes.h" -RCSID("$Id: bsd-waitpid.c,v 1.5 2003/06/01 03:23:57 mouring Exp $"); - #ifndef HAVE_WAITPID #include #include diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index 0186b5300..aae016bf7 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -37,8 +37,6 @@ #include "includes.h" -RCSID("$Id: fake-rfc2553.c,v 1.5 2003/09/22 02:08:23 dtucker Exp $"); - #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) diff --git a/packet.c b/packet.c index ca6861e55..a1e7d32f6 100644 --- a/packet.c +++ b/packet.c @@ -37,7 +37,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.122 2006/03/13 08:33:00 dtucker Exp $"); #include "openbsd-compat/sys-queue.h" #include diff --git a/progressmeter.c b/progressmeter.c index 5ae02493b..26b34a3e9 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: progressmeter.c,v 1.26 2006/02/20 17:02:44 stevesk Exp $"); #include diff --git a/readconf.c b/readconf.c index 392fc52c2..1112d0d86 100644 --- a/readconf.c +++ b/readconf.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.148 2006/02/22 00:04:44 stevesk Exp $"); #include #include diff --git a/readpass.c b/readpass.c index 811cfa231..4236c43c7 100644 --- a/readpass.c +++ b/readpass.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: readpass.c,v 1.35 2006/02/10 01:44:26 stevesk Exp $"); #include #include diff --git a/rsa.c b/rsa.c index 66561a421..507b73c9c 100644 --- a/rsa.c +++ b/rsa.c @@ -60,7 +60,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: rsa.c,v 1.24 2001/12/27 18:22:16 markus Exp $"); #include "rsa.h" #include "log.h" diff --git a/scard.c b/scard.c index b3d25058a..7cffc2d4e 100644 --- a/scard.c +++ b/scard.c @@ -24,7 +24,6 @@ #include "includes.h" #if defined(SMARTCARD) && defined(USE_SECTOK) -RCSID("$OpenBSD: scard.c,v 1.29 2004/05/08 00:21:31 djm Exp $"); #include #include diff --git a/scp.c b/scp.c index af9317645..43fd50c9e 100644 --- a/scp.c +++ b/scp.c @@ -71,7 +71,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.135 2006/02/22 00:04:44 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/servconf.c b/servconf.c index 81953bb80..2ae93d4c3 100644 --- a/servconf.c +++ b/servconf.c @@ -10,7 +10,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.146 2005/12/08 18:34:11 reyk Exp $"); #include "ssh.h" #include "log.h" diff --git a/serverloop.c b/serverloop.c index f4fb6b7b5..2ad0bcf2b 100644 --- a/serverloop.c +++ b/serverloop.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.128 2006/03/04 04:12:58 djm Exp $"); #include #include diff --git a/session.c b/session.c index 8eb1a03e5..6efaf659d 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.197 2006/02/28 01:10:21 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-client.c b/sftp-client.c index 6637feca4..c34f919a4 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -20,7 +20,6 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.60 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-common.c b/sftp-common.c index aa0757561..4222f58d6 100644 --- a/sftp-common.c +++ b/sftp-common.c @@ -24,7 +24,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-common.c,v 1.11 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sftp-glob.c b/sftp-glob.c index baa84aa71..cee44fc4c 100644 --- a/sftp-glob.c +++ b/sftp-glob.c @@ -15,7 +15,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-glob.c,v 1.17 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sftp-server.c b/sftp-server.c index 30bd1b0ee..cf3458120 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: sftp-server.c,v 1.52 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sftp.c b/sftp.c index c4f027846..d676a3771 100644 --- a/sftp.c +++ b/sftp.c @@ -15,7 +15,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp.c,v 1.75 2006/02/20 17:19:54 stevesk Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/ssh-add.c b/ssh-add.c index 59933012d..4c5cc5727 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.76 2006/03/13 10:26:52 dtucker Exp $"); #include #include diff --git a/ssh-agent.c b/ssh-agent.c index b09ce86f2..17914410c 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -34,7 +34,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.129 2006/02/20 17:02:44 stevesk Exp $"); #include #include diff --git a/ssh-dss.c b/ssh-dss.c index 381b7dedb..8250266fa 100644 --- a/ssh-dss.c +++ b/ssh-dss.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-dss.c,v 1.19 2003/11/10 16:23:41 jakob Exp $"); #include #include diff --git a/ssh-keygen.c b/ssh-keygen.c index bea4ed59b..c527252b9 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.137 2006/03/13 08:43:16 dtucker Exp $"); #include #include diff --git a/ssh-keyscan.c b/ssh-keyscan.c index f05c4697c..fee6406be 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.60 2006/03/07 09:07:40 djm Exp $"); #include "openbsd-compat/sys-queue.h" #include diff --git a/ssh-keysign.c b/ssh-keysign.c index aa0260bf8..a96babfa5 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -22,7 +22,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: ssh-keysign.c,v 1.20 2006/02/08 12:15:27 stevesk Exp $"); #ifdef HAVE_PATHS_H #include diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index d6e631317..bdf73ec48 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -50,8 +50,6 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: ssh-rand-helper.c,v 1.27 2006/03/15 03:02:36 djm Exp $"); - /* Number of bytes we write out */ #define OUTPUT_SEED_SIZE 48 diff --git a/ssh-rsa.c b/ssh-rsa.c index eb422d07e..48607c4fb 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.32 2005/06/17 02:44:33 djm Exp $"); #include #include diff --git a/ssh.c b/ssh.c index 911231a6c..9402491e3 100644 --- a/ssh.c +++ b/ssh.c @@ -40,7 +40,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.266 2006/03/12 04:23:07 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sshconnect.c b/sshconnect.c index 340270731..53b5200ff 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.176 2006/02/22 00:04:45 stevesk Exp $"); #include #include diff --git a/sshconnect1.c b/sshconnect1.c index 440d7c5bd..a39441120 100644 --- a/sshconnect1.c +++ b/sshconnect1.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect1.c,v 1.62 2005/10/30 08:52:18 djm Exp $"); #include #include diff --git a/sshconnect2.c b/sshconnect2.c index 2467d235c..b7aa96e39 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.147 2006/03/07 09:07:40 djm Exp $"); #include #include diff --git a/sshd.c b/sshd.c index aef4db109..e6b1f5496 100644 --- a/sshd.c +++ b/sshd.c @@ -42,7 +42,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.325 2006/03/13 08:16:00 djm Exp $"); #include #ifdef HAVE_SYS_STAT_H diff --git a/sshlogin.c b/sshlogin.c index 15eb916d1..718c9c412 100644 --- a/sshlogin.c +++ b/sshlogin.c @@ -39,7 +39,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshlogin.c,v 1.13 2004/08/12 09:18:24 djm Exp $"); #include "loginrec.h" #include "log.h" diff --git a/sshpty.c b/sshpty.c index 7241580a8..2e42aee11 100644 --- a/sshpty.c +++ b/sshpty.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshpty.c,v 1.16 2006/02/20 17:19:54 stevesk Exp $"); #include #include diff --git a/sshtty.c b/sshtty.c index 844a5c063..528177b4b 100644 --- a/sshtty.c +++ b/sshtty.c @@ -35,7 +35,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshtty.c,v 1.8 2006/02/07 01:52:50 stevesk Exp $"); #include diff --git a/ttymodes.c b/ttymodes.c index 7f621e30e..2c95938d9 100644 --- a/ttymodes.c +++ b/ttymodes.c @@ -43,7 +43,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: ttymodes.c,v 1.20 2006/02/07 01:42:00 stevesk Exp $"); #include diff --git a/uidswap.c b/uidswap.c index aab7064eb..ca0894806 100644 --- a/uidswap.c +++ b/uidswap.c @@ -12,7 +12,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: uidswap.c,v 1.24 2003/05/29 16:58:45 deraadt Exp $"); #include "log.h" #include "uidswap.h" diff --git a/uuencode.c b/uuencode.c index 0a7c8d16a..314eb92f3 100644 --- a/uuencode.c +++ b/uuencode.c @@ -23,7 +23,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: uuencode.c,v 1.17 2003/11/10 16:23:41 jakob Exp $"); #include "xmalloc.h" #include "uuencode.h" diff --git a/xmalloc.c b/xmalloc.c index 99c6ac330..64e439853 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -13,7 +13,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $"); #include "xmalloc.h" #include "log.h" -- cgit v1.2.3 From 73b42d2bb058da914828b53f2951954560a5b6eb Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 22 Apr 2006 21:26:08 +1000 Subject: - (djm) [Makefile.in configure.ac session.c sshpty.c] [contrib/redhat/sshd.init openbsd-compat/Makefile.in] [openbsd-compat/openbsd-compat.h openbsd-compat/port-linux.c] [openbsd-compat/port-linux.h] Add support for SELinux, setting the execution and TTY contexts. based on patch from Daniel Walsh, bz #880; ok dtucker@ --- ChangeLog | 14 +++- Makefile.in | 5 +- configure.ac | 22 +++++- contrib/redhat/sshd.init | 9 +++ openbsd-compat/Makefile.in | 4 +- openbsd-compat/openbsd-compat.h | 3 +- openbsd-compat/port-linux.c | 165 ++++++++++++++++++++++++++++++++++++++++ openbsd-compat/port-linux.h | 27 +++++++ session.c | 4 + sshpty.c | 4 + 10 files changed, 247 insertions(+), 10 deletions(-) create mode 100644 openbsd-compat/port-linux.c create mode 100644 openbsd-compat/port-linux.h (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 5328aa9c4..92a2f25d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ +20060421 + - (djm) [Makefile.in configure.ac session.c sshpty.c] + [contrib/redhat/sshd.init openbsd-compat/Makefile.in] + [openbsd-compat/openbsd-compat.h openbsd-compat/port-linux.c] + [openbsd-compat/port-linux.h] Add support for SELinux, setting + the execution and TTY contexts. based on patch from Daniel Walsh, + bz #880; ok dtucker@ + 20060418 - - (djm) Reorder IP options check so that it isn't broken by - mapped addresses; bz #1179 reported by markw wtech-llc.com; + - (djm) [canohost.c] Reorder IP options check so that it isn't broken + by mapped addresses; bz #1179 reported by markw wtech-llc.com; ok dtucker@ 20060331 @@ -4500,4 +4508,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4301 2006/04/18 05:13:16 djm Exp $ +$Id: ChangeLog,v 1.4302 2006/04/22 11:26:08 djm Exp $ diff --git a/Makefile.in b/Makefile.in index 57475f003..9bc25e7a7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.276 2006/03/15 02:09:18 djm Exp $ +# $Id: Makefile.in,v 1.277 2006/04/22 11:26:08 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -43,6 +43,7 @@ LD=@LD@ CFLAGS=@CFLAGS@ CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LIBS=@LIBS@ +LIBSELINUX=@LIBSELINUX@ LIBEDIT=@LIBEDIT@ LIBPAM=@LIBPAM@ LIBWRAP=@LIBWRAP@ @@ -136,7 +137,7 @@ ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS) $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) - $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBS) + $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBSELINUX) $(LIBS) scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) diff --git a/configure.ac b/configure.ac index 9e037ab0e..093c17643 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.338 2006/03/15 21:14:34 dtucker Exp $ +# $Id: configure.ac,v 1.339 2006/04/22 11:26:08 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.338 $) +AC_REVISION($Revision: 1.339 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -3000,6 +3000,23 @@ int main() [#include ]) ]) +# Check whether user wants SELinux support +SELINUX_MSG="no" +LIBSELINUX="" +AC_ARG_WITH(selinux, + [ --with-selinux Enable SELinux support], + [ if test "x$withval" != "xno" ; then + AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.]) + SELINUX_MSG="yes" + AC_CHECK_HEADER([selinux/selinux.h], , + AC_MSG_ERROR(SELinux support requires selinux.h header)) + AC_CHECK_LIB(selinux, setexeccon, [ LIBSELINUX="-lselinux" ], + AC_MSG_ERROR(SELinux support requires libselinux library)) + AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level) + fi ] +) +AC_SUBST(LIBSELINUX) + # Check whether user wants Kerberos 5 support KRB5_MSG="no" AC_ARG_WITH(kerberos5, @@ -3818,6 +3835,7 @@ fi echo " Manpage format: $MANTYPE" echo " PAM support: $PAM_MSG" echo " KerberosV support: $KRB5_MSG" +echo " SELinux support: $SELINUX_MSG" echo " Smartcard support: $SCARD_MSG" echo " S/KEY support: $SKEY_MSG" echo " TCP Wrappers support: $TCPW_MSG" diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init index 4ee8630c3..e5d837cbc 100755 --- a/contrib/redhat/sshd.init +++ b/contrib/redhat/sshd.init @@ -35,6 +35,9 @@ do_rsa1_keygen() { if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then chmod 600 $RSA1_KEY chmod 644 $RSA1_KEY.pub + if [ -x /sbin/restorecon ]; then + /sbin/restorecon $RSA1_KEY.pub + fi success $"RSA1 key generation" echo else @@ -51,6 +54,9 @@ do_rsa_keygen() { if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then chmod 600 $RSA_KEY chmod 644 $RSA_KEY.pub + if [ -x /sbin/restorecon ]; then + /sbin/restorecon $RSA_KEY.pub + fi success $"RSA key generation" echo else @@ -67,6 +73,9 @@ do_dsa_keygen() { if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then chmod 600 $DSA_KEY chmod 644 $DSA_KEY.pub + if [ -x /sbin/restorecon ]; then + /sbin/restorecon $DSA_KEY.pub + fi success $"DSA key generation" echo else diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index f1a706241..67e521bfe 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.38 2006/03/15 02:09:20 djm Exp $ +# $Id: Makefile.in,v 1.39 2006/04/22 11:26:08 djm Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -20,7 +20,7 @@ OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgroupl COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o -PORTS=port-irix.o port-aix.o port-uw.o port-tun.o +PORTS=port-irix.o port-linux.o port-aix.o port-uw.o port-tun.o .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 432b183e7..eda9c49eb 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.35 2006/03/15 11:25:55 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.36 2006/04/22 11:26:08 djm Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -185,6 +185,7 @@ char *shadow_pw(struct passwd *pw); #include "bsd-cray.h" #include "bsd-cygwin_util.h" #include "port-irix.h" +#include "port-linux.h" #include "port-aix.h" #include "port-uw.h" #include "port-tun.h" diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c new file mode 100644 index 000000000..54ec2910e --- /dev/null +++ b/openbsd-compat/port-linux.c @@ -0,0 +1,165 @@ +/* $Id: port-linux.c,v 1.1 2006/04/22 11:26:08 djm Exp $ */ + +/* + * Copyright (c) 2005 Daniel Walsh + * Copyright (c) 2006 Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Linux-specific portability code - just SELinux support at present + */ + +#include "includes.h" + +#ifdef WITH_SELINUX +#include "log.h" +#include "port-linux.h" + +#include +#include +#include + +/* Wrapper around is_selinux_enabled() to log its return value once only */ +static int +ssh_selinux_enabled(void) +{ + static int enabled = -1; + + if (enabled == -1) { + enabled = is_selinux_enabled(); + debug("SELinux support %s", enabled ? "enabled" : "disabled"); + } + + return (enabled); +} + +/* Return the default security context for the given username */ +static security_context_t +ssh_selinux_getctxbyname(char *pwname) +{ + security_context_t sc; + char *sename = NULL, *lvl = NULL; + int r; + +#ifdef HAVE_GETSEUSERBYNAME + if (getseuserbyname(pwname, &sename, &lvl) != 0) + return NULL; +#else + sename = pwname; + lvl = NULL; +#endif + +#ifdef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL + r = get_default_context_with_level(sename, lvl, NULL, &sc); +#else + r = get_default_context(sename, NULL, &sc); +#endif + + if (r != 0) { + switch (security_getenforce()) { + case -1: + fatal("%s: ssh_selinux_getctxbyname: " + "security_getenforce() failed", __func__); + case 0: + error("%s: Failed to get default SELinux security " + "context for %s", __func__, pwname); + default: + fatal("%s: Failed to get default SELinux security " + "context for %s (in enforcing mode)", + __func__, pwname); + } + } + +#ifdef HAVE_GETSEUSERBYNAME + if (sename != NULL) + xfree(sename); + if (lvl != NULL) + xfree(lvl); +#endif + + return (sc); +} + +/* Set the execution context to the default for the specified user */ +void +ssh_selinux_setup_exec_context(char *pwname) +{ + security_context_t user_ctx = NULL; + + if (!ssh_selinux_enabled()) + return; + + debug3("%s: setting execution context", __func__); + + user_ctx = ssh_selinux_getctxbyname(pwname); + if (setexeccon(user_ctx) != 0) { + switch (security_getenforce()) { + case -1: + fatal("%s: security_getenforce() failed", __func__); + case 0: + error("%s: Failed to set SELinux execution " + "context for %s", __func__, pwname); + default: + fatal("%s: Failed to set SELinux execution context " + "for %s (in enforcing mode)", __func__, pwname); + } + } + if (user_ctx != NULL) + freecon(user_ctx); + + debug3("%s: done", __func__); +} + +/* Set the TTY context for the specified user */ +void +ssh_selinux_setup_pty(char *pwname, const char *tty) +{ + security_context_t new_tty_ctx = NULL; + security_context_t user_ctx = NULL; + security_context_t old_tty_ctx = NULL; + + if (!ssh_selinux_enabled()) + return; + + debug3("%s: setting TTY context on %s", __func__, tty); + + user_ctx = ssh_selinux_getctxbyname(pwname); + + /* XXX: should these calls fatal() upon failure in enforcing mode? */ + + if (getfilecon(tty, &old_tty_ctx) == -1) { + error("%s: getfilecon: %s", __func__, strerror(errno)); + goto out; + } + + if (security_compute_relabel(user_ctx, old_tty_ctx, + SECCLASS_CHR_FILE, &new_tty_ctx) != 0) { + error("%s: security_compute_relabel: %s", + __func__, strerror(errno)); + goto out; + } + + if (setfilecon(tty, new_tty_ctx) != 0) + error("%s: setfilecon: %s", __func__, strerror(errno)); + out: + if (new_tty_ctx != NULL) + freecon(new_tty_ctx); + if (old_tty_ctx != NULL) + freecon(old_tty_ctx); + if (user_ctx != NULL) + freecon(user_ctx); + debug3("%s: done", __func__); +} +#endif /* WITH_SELINUX */ diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h new file mode 100644 index 000000000..05e520e1c --- /dev/null +++ b/openbsd-compat/port-linux.h @@ -0,0 +1,27 @@ +/* $Id: port-linux.h,v 1.1 2006/04/22 11:26:08 djm Exp $ */ + +/* + * Copyright (c) 2006 Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _PORT_LINUX_H +#define _PORT_LINUX_H + +#ifdef WITH_SELINUX +void ssh_selinux_setup_pty(char *, const char *); +void ssh_selinux_setup_exec_context(char *); +#endif + +#endif /* ! _PORT_LINUX_H */ diff --git a/session.c b/session.c index 8b837d07d..bba3fa21f 100644 --- a/session.c +++ b/session.c @@ -1352,6 +1352,10 @@ do_setusercontext(struct passwd *pw) #endif if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) fatal("Failed to set uids to %u.", (u_int) pw->pw_uid); + +#ifdef WITH_SELINUX + ssh_selinux_setup_exec_context(pw->pw_name); +#endif } static void diff --git a/sshpty.c b/sshpty.c index a15df0414..0e49e9a16 100644 --- a/sshpty.c +++ b/sshpty.c @@ -210,6 +210,10 @@ pty_setowner(struct passwd *pw, const char *tty) fatal("stat(%.100s) failed: %.100s", tty, strerror(errno)); +#ifdef WITH_SELINUX + ssh_selinux_setup_pty(pw->pw_name, tty); +#endif + if (st.st_uid != pw->pw_uid || st.st_gid != gid) { if (chown(tty, pw->pw_uid, gid) < 0) { if (errno == EROFS && -- cgit v1.2.3 From d8093e49bf06813a8c97cbc90810f4863388af77 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 4 May 2006 16:24:34 +1000 Subject: - (dtucker) [auth-pam.c groupaccess.c monitor.c monitor_wrap.c scard-opensc.c session.c ssh-rand-helper.c sshd.c openbsd-compat/bsd-cygwin_util.c openbsd-compat/setproctitle.c] Convert malloc(foo*bar) -> calloc(foo,bar) in Portable-only code; since calloc zeros, remove now-redundant memsets. Also add a couple of sanity checks. With & ok djm@ --- ChangeLog | 9 ++++++++- auth-pam.c | 14 +++++++------- groupaccess.c | 4 ++-- monitor.c | 2 +- monitor_wrap.c | 7 +++++-- openbsd-compat/bsd-cygwin_util.c | 2 +- openbsd-compat/setproctitle.c | 2 +- scard-opensc.c | 4 +++- session.c | 2 +- ssh-rand-helper.c | 3 +-- sshd.c | 2 +- 11 files changed, 31 insertions(+), 20 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 49e831187..fe0536a78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +20060504 + - (dtucker) [auth-pam.c groupaccess.c monitor.c monitor_wrap.c scard-opensc.c + session.c ssh-rand-helper.c sshd.c openbsd-compat/bsd-cygwin_util.c + openbsd-compat/setproctitle.c] Convert malloc(foo*bar) -> calloc(foo,bar) + in Portable-only code; since calloc zeros, remove now-redundant memsets. + Also add a couple of sanity checks. With & ok djm@ + 20060503 - (dtucker) [packet.c] Remove in_systm.h since it's also in includes.h and double including it on IRIX 5.3 causes problems. From Georg Schwarz, @@ -4587,4 +4594,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4319 2006/05/03 09:01:09 dtucker Exp $ +$Id: ChangeLog,v 1.4320 2006/05/04 06:24:34 dtucker Exp $ diff --git a/auth-pam.c b/auth-pam.c index c12f413e7..5ddc8bec3 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -288,7 +288,10 @@ import_environments(Buffer *b) /* Import environment from subprocess */ num_env = buffer_get_int(b); - sshpam_env = xmalloc((num_env + 1) * sizeof(*sshpam_env)); + if (num_env > 1024) + fatal("%s: received %u environment variables, expected <= 1024", + __func__, num_env); + sshpam_env = xcalloc(num_env + 1, sizeof(*sshpam_env)); debug3("PAM: num env strings %d", num_env); for(i = 0; i < num_env; i++) sshpam_env[i] = buffer_get_string(b, NULL); @@ -335,9 +338,8 @@ sshpam_thread_conv(int n, sshpam_const struct pam_message **msg, if (n <= 0 || n > PAM_MAX_NUM_MSG) return (PAM_CONV_ERR); - if ((reply = malloc(n * sizeof(*reply))) == NULL) + if ((reply = calloc(n, sizeof(*reply))) == NULL) return (PAM_CONV_ERR); - memset(reply, 0, n * sizeof(*reply)); buffer_init(&buffer); for (i = 0; i < n; ++i) { @@ -533,9 +535,8 @@ sshpam_store_conv(int n, sshpam_const struct pam_message **msg, if (n <= 0 || n > PAM_MAX_NUM_MSG) return (PAM_CONV_ERR); - if ((reply = malloc(n * sizeof(*reply))) == NULL) + if ((reply = calloc(n, sizeof(*reply))) == NULL) return (PAM_CONV_ERR); - memset(reply, 0, n * sizeof(*reply)); for (i = 0; i < n; ++i) { switch (PAM_MSG_MEMBER(msg, i, msg_style)) { @@ -935,9 +936,8 @@ sshpam_tty_conv(int n, sshpam_const struct pam_message **msg, if (n <= 0 || n > PAM_MAX_NUM_MSG || !isatty(STDIN_FILENO)) return (PAM_CONV_ERR); - if ((reply = malloc(n * sizeof(*reply))) == NULL) + if ((reply = calloc(n, sizeof(*reply))) == NULL) return (PAM_CONV_ERR); - memset(reply, 0, n * sizeof(*reply)); for (i = 0; i < n; ++i) { switch (PAM_MSG_MEMBER(msg, i, msg_style)) { diff --git a/groupaccess.c b/groupaccess.c index 83c573def..2a85cb375 100644 --- a/groupaccess.c +++ b/groupaccess.c @@ -52,8 +52,8 @@ ga_init(const char *user, gid_t base) ngroups = MAX(NGROUPS_MAX, sysconf(_SC_NGROUPS_MAX)); #endif - groups_bygid = xmalloc(ngroups * sizeof(*groups_bygid)); - groups_byname = xmalloc(ngroups * sizeof(*groups_byname)); + groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid)); + groups_byname = xcalloc(ngroups, sizeof(*groups_byname)); if (getgrouplist(user, base, groups_bygid, &ngroups) == -1) logit("getgrouplist: groups list too small"); diff --git a/monitor.c b/monitor.c index 894523da3..4b8287d85 100644 --- a/monitor.c +++ b/monitor.c @@ -924,7 +924,7 @@ mm_answer_pam_respond(int sock, Buffer *m) sshpam_authok = NULL; num = buffer_get_int(m); if (num > 0) { - resp = xmalloc(num * sizeof(char *)); + resp = xcalloc(num, sizeof(char *)); for (i = 0; i < num; ++i) resp[i] = buffer_get_string(m, NULL); ret = (sshpam_device.respond)(sshpam_ctxt, num, resp); diff --git a/monitor_wrap.c b/monitor_wrap.c index 8cfc8cc08..332652895 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -776,8 +776,11 @@ mm_sshpam_query(void *ctx, char **name, char **info, *name = buffer_get_string(&m, NULL); *info = buffer_get_string(&m, NULL); *num = buffer_get_int(&m); - *prompts = xmalloc((*num + 1) * sizeof(char *)); - *echo_on = xmalloc((*num + 1) * sizeof(u_int)); + if (*num > PAM_MAX_NUM_MSG) + fatal("%s: recieved %u PAM messages, expected <= %u", + __func__, *num, PAM_MAX_NUM_MSG); + *prompts = xcalloc((*num + 1), sizeof(char *)); + *echo_on = xcalloc((*num + 1), sizeof(u_int)); for (i = 0; i < *num; ++i) { (*prompts)[i] = buffer_get_string(&m, NULL); (*echo_on)[i] = buffer_get_int(&m); diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 8f3acee26..b408dde2d 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -268,7 +268,7 @@ fetch_windows_environment(void) char **e, **p; unsigned int i, idx = 0; - p = xmalloc((WENV_SIZ + 1) * sizeof(char *)); + p = xcalloc(WENV_SIZ + 1, sizeof(char *)); for (e = environ; *e != NULL; ++e) { for (i = 0; i < WENV_SIZ; ++i) { if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen)) diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index 6e2b19bb4..95b662e4d 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c @@ -80,7 +80,7 @@ compat_init_setproctitle(int argc, char *argv[]) /* Fail if we can't allocate room for the new environment */ for (i = 0; envp[i] != NULL; i++) ; - if ((environ = malloc(sizeof(*environ) * (i + 1))) == NULL) { + if ((environ = calloc(i + 1, sizeof(*environ))) == NULL) { environ = envp; /* put it back */ return; } diff --git a/scard-opensc.c b/scard-opensc.c index dd2c28df2..7a496dff8 100644 --- a/scard-opensc.c +++ b/scard-opensc.c @@ -455,7 +455,9 @@ sc_get_keys(const char *id, const char *pin) } key_count = r; } - keys = xmalloc(sizeof(Key *) * (key_count*2+1)); + if (key_count > 1024) + fatal("Too many keys (%u), expected <= 1024", key_count); + keys = xcalloc(key_count * 2 + 1, sizeof(Key *)); for (i = 0; i < key_count; i++) { sc_pkcs15_object_t *tmp_obj = NULL; cert_id = ((sc_pkcs15_cert_info_t *)(certs[i]->data))->id; diff --git a/session.c b/session.c index caf750ab4..87e7ee6e3 100644 --- a/session.c +++ b/session.c @@ -984,7 +984,7 @@ do_setup_env(Session *s, const char *shell) /* Initialize the environment. */ envsize = 100; - env = xmalloc(envsize * sizeof(char *)); + env = xcalloc(envsize, sizeof(char *)); env[0] = NULL; #ifdef HAVE_CYGWIN diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index 662f70080..3a4a165fa 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -674,8 +674,7 @@ prng_read_commands(char *cmdfilename) } num_cmds = 64; - entcmd = xmalloc(num_cmds * sizeof(entropy_cmd_t)); - memset(entcmd, '\0', num_cmds * sizeof(entropy_cmd_t)); + entcmd = xcalloc(num_cmds, sizeof(entropy_cmd_t)); /* Read in file */ cur_cmd = linenum = 0; diff --git a/sshd.c b/sshd.c index a206db245..e707cf654 100644 --- a/sshd.c +++ b/sshd.c @@ -921,7 +921,7 @@ main(int ac, char **av) /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ saved_argc = ac; rexec_argc = ac; - saved_argv = xmalloc(sizeof(*saved_argv) * (ac + 1)); + saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); for (i = 0; i < ac; i++) saved_argv[i] = xstrdup(av[i]); saved_argv[i] = NULL; -- cgit v1.2.3 From 13c539a4dcfa7a7fb34bbd43478aa913e27b8ba6 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 15 May 2006 17:15:56 +1000 Subject: - (dtucker) [openbsd-compat/getrrsetbyname.c] Use _compat_res instead of _res, prevents problems on some platforms that have _res as a global but don't have getrrsetbyname(), eg IRIX 5.3. Found and tested by georg.schwarz at freenet.de, ok djm@. --- ChangeLog | 8 +++++++- openbsd-compat/getrrsetbyname.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1e1bfade5..0a9110633 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20050515 + - (dtucker) [openbsd-compat/getrrsetbyname.c] Use _compat_res instead of + _res, prevents problems on some platforms that have _res as a global but + don't have getrrsetbyname(), eg IRIX 5.3. Found and tested by + georg.schwarz at freenet.de, ok djm@. + 20050506 - (dtucker) OpenBSD CVS Syn - dtucker@cvs.openbsd.org 2006/04/25 08:02:27 @@ -4611,4 +4617,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4324 2006/05/06 08:40:53 dtucker Exp $ +$Id: ChangeLog,v 1.4325 2006/05/15 07:15:56 dtucker Exp $ diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index bea6aea3b..8dc744703 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -60,6 +60,10 @@ extern int h_errno; # undef _THREAD_PRIVATE #endif #define _THREAD_PRIVATE(a,b,c) (c) + +/* to avoid conflicts where a platform already has _res */ +#define _res _compat_res + struct __res_state _res; /* Necessary functions and macros */ -- cgit v1.2.3 From 3eb4834489426bd796da90299b2f8174b744dddd Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 23 Jun 2006 21:05:12 +1000 Subject: - (dtucker) [README.platform configure.ac openbsd-compat/port-tun.c] Add tunnel support for Mac OS X/Darwin via a third-party tun driver. Patch from reyk@, tested by anil@ --- ChangeLog | 7 ++++++- INSTALL | 12 +++++++----- README.platform | 14 +++++++++++++- configure.ac | 10 ++++++++-- openbsd-compat/port-tun.c | 4 ++++ 5 files changed, 38 insertions(+), 9 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 30cd23659..327fec1d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20060623 + - (dtucker) [README.platform configure.ac openbsd-compat/port-tun.c] Add + tunnel support for Mac OS X/Darwin via a third-party tun driver. Patch + from reyk@, tested by anil@ + 20060613 - (djm) [getput.h] This file has been replaced by functions in misc.c - OpenBSD CVS Sync @@ -4685,4 +4690,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4344 2006/06/13 03:15:54 djm Exp $ +$Id: ChangeLog,v 1.4345 2006/06/23 11:05:12 dtucker Exp $ diff --git a/INSTALL b/INSTALL index 38f39473f..efc7b47d0 100644 --- a/INSTALL +++ b/INSTALL @@ -57,9 +57,10 @@ installed. No other S/Key library is currently known to be supported. http://www.sparc.spb.su/solaris/skey/ LibEdit: -sftp now supports command-line editing via NetBSD's libedit. If your -platform has it available natively you can use that, alternatively -you might try these multi-platform ports: + +sftp supports command-line editing via NetBSD's libedit. If your platform +has it available natively you can use that, alternatively you might try +these multi-platform ports: http://www.thrysoee.dk/editline/ http://sourceforge.net/projects/libedit/ @@ -210,7 +211,8 @@ for sshd, ssh and ssh-agent. ------------------------- $ make survey -[check the contents and make sure there's no sensitive information] +[check the contents of the file "survey" to ensure there's no information +that you consider sensitive] $ make send-survey This will send configuration information for the currently configured @@ -227,4 +229,4 @@ Please refer to the "reporting bugs" section of the webpage at http://www.openssh.com/ -$Id: INSTALL,v 1.71 2006/02/20 09:17:36 dtucker Exp $ +$Id: INSTALL,v 1.72 2006/06/23 11:05:13 dtucker Exp $ diff --git a/README.platform b/README.platform index 4c18a3278..b7dc3f91c 100644 --- a/README.platform +++ b/README.platform @@ -30,6 +30,18 @@ gcc, gcc-mingw-core, mingw-runtime, binutils, make, openssl, openssl-devel, zlib, minres, minires-devel. +Darwin and MacOS X +------------------ +Darwin does not provide a tun(4) driver required for OpenSSH-based +virtual private networks. The BSD manpage still exists, but the driver +has been removed in recent releases of Darwin and MacOS X. + +Nevertheless, tunnel support is known to work with Darwin 8 and +MacOS X 10.4 in Point-to-Point (Layer 3) and Ethernet (Layer 2) mode +using a third party driver. More information is available at: + http://www-user.rhrk.uni-kl.de/~nissler/tuntap/ + + Solaris ------- If you enable BSM auditing on Solaris, you need to update audit_event(4) @@ -55,4 +67,4 @@ account stacks which will prevent authentication entirely, but will still return the output from pam_nologin to the client. -$Id: README.platform,v 1.6 2005/11/05 05:28:35 dtucker Exp $ +$Id: README.platform,v 1.7 2006/06/23 11:05:13 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 093c17643..c3cb68f28 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.339 2006/04/22 11:26:08 djm Exp $ +# $Id: configure.ac,v 1.340 2006/06/23 11:05:13 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.339 $) +AC_REVISION($Revision: 1.340 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -231,6 +231,11 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) AC_DEFINE(BROKEN_SETREGID) AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1, [Define if your resolver libs need this for getrrsetbyname]) + AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) + AC_DEFINE(SSH_TUN_COMPAT_AF, 1, + [Use tunnel device compatibility to OpenBSD]) + AC_DEFINE(SSH_TUN_PREPEND_AF, 1, + [Prepend the address family to IP tunnel traffic]) ;; *-*-hpux*) # first we define all of the options common to all HP-UX releases @@ -682,6 +687,7 @@ AC_CHECK_HEADERS( \ login.h \ maillock.h \ ndir.h \ + net/if_tun.h \ netdb.h \ netgroup.h \ pam/pam_appl.h \ diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index d09fe3d06..6e1fed969 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -29,6 +29,7 @@ * settings. * * SSH_TUN_LINUX Use the (newer) Linux tun/tap device + * SSH_TUN_FREEBSD Use the FreeBSD tun/tap device * SSH_TUN_COMPAT_AF Translate the OpenBSD address family * SSH_TUN_PREPEND_AF Prepend/remove the address family */ @@ -96,7 +97,10 @@ sys_tun_open(int tun, int mode) #ifdef SSH_TUN_FREEBSD #include #include + +#ifdef HAVE_NET_IF_TUN_H #include +#endif int sys_tun_open(int tun, int mode) -- cgit v1.2.3 From 66c32d5caa533560a16638ab688772833e602d28 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 30 Jun 2006 10:51:32 +1000 Subject: - (dtucker) [openbsd-compat/openbsd-compat.h] SNPRINTF_CONST for snprintf declaration too. Patch from russ at sludge.net. --- ChangeLog | 6 +++++- openbsd-compat/openbsd-compat.h | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 01fa36e83..09c459200 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20060630 + - (dtucker) [openbsd-compat/openbsd-compat.h] SNPRINTF_CONST for snprintf + declaration too. Patch from russ at sludge.net. + 20060627 - (dtucker) [configure.ac] Bug #1203: Add missing '[', which causes problems with autoconf 2.60. Patch from vapier at gentoo.org. @@ -4712,4 +4716,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4350 2006/06/27 01:20:28 dtucker Exp $ +$Id: ChangeLog,v 1.4351 2006/06/30 00:51:32 dtucker Exp $ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index eda9c49eb..37c979fa4 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.36 2006/04/22 11:26:08 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.37 2006/06/30 00:51:32 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -154,7 +154,7 @@ int openpty(int *, int *, char *, struct termios *, struct winsize *); /* #include XXX needed? For size_t */ #ifndef HAVE_SNPRINTF -int snprintf(char *, size_t, const char *, ...); +int snprintf(char *, size_t, SNPRINTF_CONST char *, ...); #endif #ifndef HAVE_STRTOLL -- cgit v1.2.3 From 7243f9db6034bc9fac9d9b88217cc465b3ded3ca Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 30 Jun 2006 11:47:49 +1000 Subject: - (dtucker) [openbsd-compat/getrrsetbyname.c] Undef _res before defining it, prevents warnings on platforms where _res is in the system headers. --- ChangeLog | 4 +++- openbsd-compat/getrrsetbyname.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 09c459200..9dad80a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20060630 - (dtucker) [openbsd-compat/openbsd-compat.h] SNPRINTF_CONST for snprintf declaration too. Patch from russ at sludge.net. + - (dtucker) [openbsd-compat/getrrsetbyname.c] Undef _res before defining it, + prevents warnings on platforms where _res is in the system headers. 20060627 - (dtucker) [configure.ac] Bug #1203: Add missing '[', which causes problems @@ -4716,4 +4718,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4351 2006/06/30 00:51:32 dtucker Exp $ +$Id: ChangeLog,v 1.4352 2006/06/30 01:47:49 dtucker Exp $ diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 8dc744703..a855ad6d5 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -62,6 +62,9 @@ extern int h_errno; #define _THREAD_PRIVATE(a,b,c) (c) /* to avoid conflicts where a platform already has _res */ +#ifdef _res +# undef _res +#endif #define _res _compat_res struct __res_state _res; -- cgit v1.2.3 From a1738e4c65108b9c549c66c3a668a04b86c1530c Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 10 Jul 2006 21:33:04 +1000 Subject: - (djm) [loginrec.c ssh-rand-helper.c sshd.c openbsd-compat/glob.c] [openbsd-compat/mktemp.c openbsd-compat/openbsd-compat.h] [openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c] [openbsd-compat/xcrypt.c] Fix includes.h fallout, mainly fcntl.h --- ChangeLog | 6 +++++- loginrec.c | 1 + openbsd-compat/glob.c | 1 + openbsd-compat/mktemp.c | 1 + openbsd-compat/openbsd-compat.h | 8 ++++---- openbsd-compat/port-tun.c | 3 +++ openbsd-compat/readpassphrase.c | 1 + openbsd-compat/xcrypt.c | 3 +++ ssh-rand-helper.c | 1 + sshd.c | 1 + 10 files changed, 21 insertions(+), 5 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 9646e8c42..30356693d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,10 @@ - djm@cvs.openbsd.org 2006/07/10 11:25:53 [sftp-server.c] don't log variables that aren't yet set + - (djm) [loginrec.c ssh-rand-helper.c sshd.c openbsd-compat/glob.c] + [openbsd-compat/mktemp.c openbsd-compat/openbsd-compat.h] + [openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c] + [openbsd-compat/xcrypt.c] Fix includes.h fallout, mainly fcntl.h 20060706 - (dtucker) [configure.ac] Try AIX blibpath test in different order when @@ -4816,4 +4820,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4380 2006/07/10 11:31:27 djm Exp $ +$Id: ChangeLog,v 1.4381 2006/07/10 11:33:04 djm Exp $ diff --git a/loginrec.c b/loginrec.c index 42f022fd9..a27a3ae61 100644 --- a/loginrec.c +++ b/loginrec.c @@ -153,6 +153,7 @@ #include +#include #include #include "ssh.h" diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index fd3d86c4c..439d2f50d 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -38,6 +38,7 @@ #include #include #include +#include static long get_arg_max(void) diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 53a50c512..75a339156 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -37,6 +37,7 @@ #include #include +#include #include #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 37c979fa4..6231e03a2 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.37 2006/06/30 00:51:32 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.38 2006/07/10 11:33:05 djm Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -31,6 +31,9 @@ #include "includes.h" +#include +#include + /* OpenBSD function replacements */ #include "base64.h" #include "sigact.h" @@ -131,8 +134,6 @@ int BSDgetopt(int argc, char * const *argv, const char *opts); #include "bsd-misc.h" #include "bsd-waitpid.h" -/*#include XXX Still needed? * For uid_t, gid_t * */ - #ifndef HAVE_GETPEEREID int getpeereid(int , uid_t *, gid_t *); #endif @@ -177,7 +178,6 @@ void *xmmap(size_t size); char *xcrypt(const char *password, const char *salt); char *shadow_pw(struct passwd *pw); - /* rfc2553 socket API replacements */ #include "fake-rfc2553.h" diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index 6e1fed969..a87b809d5 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -16,9 +16,12 @@ #include "includes.h" +#include #include #include +#include + #include "log.h" #include "misc.h" #include "bufaux.h" diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 95e26dcd4..95c0af815 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #ifdef TCSASOFT diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index 9afa0b9f2..5d260f2c2 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c @@ -24,6 +24,9 @@ #include "includes.h" +#include +#include + # ifdef HAVE_CRYPT_H # include # endif diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index feb1bfb18..ebee90014 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -36,6 +36,7 @@ # include #endif +#include #include #include diff --git a/sshd.c b/sshd.c index 591622fd0..602116edf 100644 --- a/sshd.c +++ b/sshd.c @@ -56,6 +56,7 @@ #ifdef HAVE_PATHS_H #include #endif +#include #include #include -- cgit v1.2.3 From 4e880e632be69861af52a90dcdf337deb60ca536 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 11 Jul 2006 00:20:51 +1000 Subject: - (dtucker) [openbsd-compat/openbsd-compat.h] Need to include for struct sockaddr on platforms that use the fake-rfc stuff. --- ChangeLog | 4 +++- openbsd-compat/openbsd-compat.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 56cee8708..6c4cf92c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -104,6 +104,8 @@ format is unchanged, otherwise the host name or address is enclosed within square brackets in the same format as sshd's ListenAddress. Tested by many, ok markus@. + - (dtucker) [openbsd-compat/openbsd-compat.h] Need to include + for struct sockaddr on platforms that use the fake-rfc stuff. 20060706 - (dtucker) [configure.ac] Try AIX blibpath test in different order when @@ -4837,4 +4839,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4384 2006/07/10 13:04:19 dtucker Exp $ +$Id: ChangeLog,v 1.4385 2006/07/10 14:20:51 dtucker Exp $ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 6231e03a2..8b885178c 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.38 2006/07/10 11:33:05 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.39 2006/07/10 14:20:52 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -34,6 +34,8 @@ #include #include +#include + /* OpenBSD function replacements */ #include "base64.h" #include "sigact.h" -- cgit v1.2.3 From 44c828fe29e61126ae5ff9e71e1a76a55f5fa34b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 11 Jul 2006 18:00:06 +1000 Subject: - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c openbsd-compat/daemon.c] Add includes needed by open(2). Conditionally include paths.h. Fixes build error on Solaris. --- ChangeLog | 7 ++++++- configure.ac | 5 +++-- openbsd-compat/bsd-openpty.c | 10 ++++++++++ openbsd-compat/daemon.c | 10 ++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 6c4cf92c0..9ca297bf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20060711 + - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c + openbsd-compat/daemon.c] Add includes needed by open(2). Conditionally + include paths.h. Fixes build error on Solaris. + 20060710 - (dtucker) [INSTALL] New autoconf version: 2.60. - OpenBSD CVS Sync @@ -4839,4 +4844,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4385 2006/07/10 14:20:51 dtucker Exp $ +$Id: ChangeLog,v 1.4386 2006/07/11 08:00:06 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 252e7a993..c6d56bf4a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.344 2006/07/06 01:56:25 dtucker Exp $ +# $Id: configure.ac,v 1.345 2006/07/11 08:00:06 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.344 $) +AC_REVISION($Revision: 1.345 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -686,6 +686,7 @@ AC_CHECK_HEADERS( \ dirent.h \ endian.h \ features.h \ + fcntl.h \ floatingpoint.h \ getopt.h \ glob.h \ diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index 28929de67..0b77a1da9 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -35,6 +35,16 @@ #include "includes.h" #if !defined(HAVE_OPENPTY) +#include + +#ifdef HAVE_SYS_STAT_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + #ifdef HAVE_UTIL_H # include #endif /* HAVE_UTIL_H */ diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c index f8a0680bf..f380139d3 100644 --- a/openbsd-compat/daemon.c +++ b/openbsd-compat/daemon.c @@ -34,6 +34,16 @@ #ifndef HAVE_DAEMON +#include + +#ifdef HAVE_SYS_STAT_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + int daemon(int nochdir, int noclose) { -- cgit v1.2.3 From 686852f665376c2287c716f8d388b42c1727210b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 19:05:56 +1000 Subject: - (dtucker) [openbsd-compat/port-tun.c] OpenBSD needs before . --- ChangeLog | 4 +++- openbsd-compat/port-tun.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1f11e32bc..ba0b72033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Linuxes and probably more. - (dtucker) [configure.ac] OpenBSD needs before for SHUT_RD. + - (dtucker) [openbsd-compat/port-tun.c] OpenBSD needs before + . 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4853,4 +4855,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4390 2006/07/12 09:02:56 dtucker Exp $ +$Id: ChangeLog,v 1.4391 2006/07/12 09:05:56 dtucker Exp $ diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index a87b809d5..bee6b160c 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -18,6 +18,7 @@ #include #include +#include #include #include -- cgit v1.2.3 From c931c433f60a515af4cd463815ad3f9cf75ba3d9 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 22:35:51 +1000 Subject: - (dtucker) [openbsd-compat/xmmap.c] Include . --- ChangeLog | 3 ++- openbsd-compat/xmmap.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 5d86e4451..eff2102d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,7 @@ will allow port forwarding by all users except "anoncvs". Currently only a very small subset of directives are supported. ok djm@ + - (dtucker) [openbsd-compat/xmmap.c] Include . 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4904,4 +4905,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4400 2006/07/12 12:34:17 dtucker Exp $ +$Id: ChangeLog,v 1.4401 2006/07/12 12:35:51 dtucker Exp $ diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 68ac91192..7d5cc812c 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.7 2006/03/15 02:02:31 djm Exp $ */ +/* $Id: xmmap.c,v 1.8 2006/07/12 12:35:52 dtucker Exp $ */ #include "includes.h" @@ -33,6 +33,8 @@ #endif #include +#include + #include "log.h" void *xmmap(size_t size) -- cgit v1.2.3 From 2c1a02a8d03069163d8cae21484f4e5656e904fe Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 22:40:50 +1000 Subject: - (dtucker) [loginrec.c openbsd-compat/xmmap.c openbsd-compat/bindresvport.c openbsd-compat/glob.c openbsd-compat/mktemp.c openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c openbsd-compat/strtonum.c] Include . --- ChangeLog | 6 ++++-- loginrec.c | 1 + openbsd-compat/bindresvport.c | 2 ++ openbsd-compat/glob.c | 2 ++ openbsd-compat/mktemp.c | 2 ++ openbsd-compat/port-tun.c | 1 + openbsd-compat/readpassphrase.c | 1 + openbsd-compat/strtonum.c | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index eff2102d5..4f585990b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,7 +55,9 @@ will allow port forwarding by all users except "anoncvs". Currently only a very small subset of directives are supported. ok djm@ - - (dtucker) [openbsd-compat/xmmap.c] Include . + - (dtucker) [loginrec.c openbsd-compat/xmmap.c openbsd-compat/bindresvport.c + openbsd-compat/glob.c openbsd-compat/mktemp.c openbsd-compat/port-tun.c + openbsd-compat/readpassphrase.c openbsd-compat/strtonum.c] Include . 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4905,4 +4907,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4401 2006/07/12 12:35:51 dtucker Exp $ +$Id: ChangeLog,v 1.4402 2006/07/12 12:40:50 dtucker Exp $ diff --git a/loginrec.c b/loginrec.c index a27a3ae61..8299b79e4 100644 --- a/loginrec.c +++ b/loginrec.c @@ -153,6 +153,7 @@ #include +#include #include #include diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index 7f48fd03a..2c16233c9 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -36,6 +36,8 @@ #include "includes.h" +#include + #define STARTPORT 600 #define ENDPORT (IPPORT_RESERVED - 1) #define NPORTS (ENDPORT - STARTPORT + 1) diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 439d2f50d..bba4c0976 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -34,10 +34,12 @@ /* OPENBSD ORIGINAL: lib/libc/gen/glob.c */ #include "includes.h" + #include #include #include #include +#include #include static long diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 75a339156..b8b0793a6 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -37,8 +37,10 @@ #include #include + #include #include +#include #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index bee6b160c..9806eec7d 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -21,6 +21,7 @@ #include #include +#include #include #include "log.h" diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 95c0af815..fd9731ac6 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef TCSASOFT # define _T_FLUSH (TCSAFLUSH|TCSASOFT) diff --git a/openbsd-compat/strtonum.c b/openbsd-compat/strtonum.c index 8ad0d0058..35c5c18b9 100644 --- a/openbsd-compat/strtonum.c +++ b/openbsd-compat/strtonum.c @@ -22,6 +22,7 @@ #include "includes.h" #ifndef HAVE_STRTONUM #include +#include #define INVALID 1 #define TOOSMALL 2 -- cgit v1.2.3 From 767e4134f13ed22a941f2fb747026b0881f9e827 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 22:43:28 +1000 Subject: - (dtucker) [openbsd-compat/setproctitle.c] Include stdarg.h. --- ChangeLog | 3 ++- openbsd-compat/setproctitle.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 4f585990b..72c56bebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,7 @@ - (dtucker) [loginrec.c openbsd-compat/xmmap.c openbsd-compat/bindresvport.c openbsd-compat/glob.c openbsd-compat/mktemp.c openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c openbsd-compat/strtonum.c] Include . + - (dtucker) [openbsd-compat/setproctitle.c] Include stdarg.h. 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4907,4 +4908,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4402 2006/07/12 12:40:50 dtucker Exp $ +$Id: ChangeLog,v 1.4403 2006/07/12 12:43:28 dtucker Exp $ diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index 95b662e4d..32e987deb 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c @@ -35,6 +35,7 @@ #ifndef HAVE_SETPROCTITLE +#include #include #ifdef HAVE_SYS_PSTAT_H #include -- cgit v1.2.3 From 5998ed03aadef4c9681e90b669ddd1c5d7a9247b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 23:10:33 +1000 Subject: - (dtucker) [openbsd-compat/openbsd-compat.h] v*printf needs stdarg.h. --- ChangeLog | 3 ++- openbsd-compat/openbsd-compat.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 72ae6946a..d5e8afede 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,7 @@ openbsd-compat/readpassphrase.c openbsd-compat/strtonum.c] Include . - (dtucker) [openbsd-compat/setproctitle.c] Include stdarg.h. - (dtucker) [ssh-keyscan.c ssh-rand-helper.c] More errno.h here too. + - (dtucker) [openbsd-compat/openbsd-compat.h] v*printf needs stdarg.h. 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4909,4 +4910,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4404 2006/07/12 12:44:34 dtucker Exp $ +$Id: ChangeLog,v 1.4405 2006/07/12 13:10:33 dtucker Exp $ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 8b885178c..18249d81e 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.39 2006/07/10 14:20:52 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.40 2006/07/12 13:10:34 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -168,6 +168,10 @@ long long strtoll(const char *, char **, int); long long strtonum(const char *, long long, long long, const char **); #endif +#if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF) +# include +#endif + #ifndef HAVE_VASPRINTF int vasprintf(char **, const char *, va_list); #endif -- cgit v1.2.3 From 2eaea99054fd65ad03f1fe9679a318253eaa8dd6 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 12 Jul 2006 23:41:33 +1000 Subject: - (dtucker) [openbsd-compat/bsd-asprintf.c openbsd-compat/port-aix.c openbsd-compat/rresvport.c] More errno.h. --- ChangeLog | 5 ++++- openbsd-compat/bsd-asprintf.c | 3 +++ openbsd-compat/port-aix.c | 1 + openbsd-compat/rresvport.c | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index d5e8afede..478b816fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,9 @@ - (dtucker) [openbsd-compat/setproctitle.c] Include stdarg.h. - (dtucker) [ssh-keyscan.c ssh-rand-helper.c] More errno.h here too. - (dtucker) [openbsd-compat/openbsd-compat.h] v*printf needs stdarg.h. + - (dtucker) [openbsd-compat/bsd-asprintf.c openbsd-compat/port-aix.c + openbsd-compat/rresvport.c] More errno.h. + 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c @@ -4910,4 +4913,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4405 2006/07/12 13:10:33 dtucker Exp $ +$Id: ChangeLog,v 1.4406 2006/07/12 13:41:33 dtucker Exp $ diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c index 5ca01f80f..1178296f8 100644 --- a/openbsd-compat/bsd-asprintf.c +++ b/openbsd-compat/bsd-asprintf.c @@ -21,6 +21,9 @@ #ifndef HAVE_VASPRINTF +#include +#include + #ifndef VA_COPY # ifdef HAVE_VA_COPY # define VA_COPY(dest, src) va_copy(dest, src) diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 81d8124e0..33be00c2b 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -33,6 +33,7 @@ #ifdef _AIX +#include #include #include #include "port-aix.h" diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index 71cf6e6eb..fc029f46f 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -35,6 +35,8 @@ #ifndef HAVE_RRESVPORT_AF +#include + #if 0 int rresvport(int *alport) -- cgit v1.2.3 From be43ebf97579d13e108256c6440cb22a08f12ebc Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 24 Jul 2006 13:51:51 +1000 Subject: - stevesk@cvs.openbsd.org 2006/07/12 22:28:52 [auth-options.c canohost.c channels.c includes.h readconf.c servconf.c ssh-keyscan.c ssh.c sshconnect.c sshd.c] move #include out of includes.h; ok djm@ --- ChangeLog | 5 ++++- auth-options.c | 5 ++++- canohost.c | 5 ++++- channels.c | 5 ++++- dns.c | 4 +++- includes.h | 5 +---- logintest.c | 4 +++- openbsd-compat/fake-rfc2553.h | 7 +++++-- openbsd-compat/port-aix.c | 3 +++ readconf.c | 5 ++++- servconf.c | 6 +++++- ssh-keygen.c | 3 +++ ssh-keyscan.c | 7 +++++-- ssh.c | 5 ++++- sshconnect.c | 5 ++++- sshd.c | 5 ++++- 16 files changed, 60 insertions(+), 19 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 4f75fe5b1..16c419c1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ - new sentence, new line - s/The the/The/ - kill a bad comma + - stevesk@cvs.openbsd.org 2006/07/12 22:28:52 + [auth-options.c canohost.c channels.c includes.h readconf.c servconf.c ssh-keyscan.c ssh.c sshconnect.c sshd.c] + move #include out of includes.h; ok djm@ 20060713 - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h @@ -4923,4 +4926,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4408 2006/07/24 03:46:50 djm Exp $ +$Id: ChangeLog,v 1.4409 2006/07/24 03:51:51 djm Exp $ diff --git a/auth-options.c b/auth-options.c index 473fb8bf7..0b11151cf 100644 --- a/auth-options.c +++ b/auth-options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.36 2006/07/06 16:03:53 stevesk Exp $ */ +/* $OpenBSD: auth-options.c,v 1.37 2006/07/12 22:28:51 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -14,6 +14,9 @@ #include +#if defined(HAVE_NETDB_H) +# include +#endif #include #include "xmalloc.h" diff --git a/canohost.c b/canohost.c index 4566e2ab1..da5131de3 100644 --- a/canohost.c +++ b/canohost.c @@ -1,4 +1,4 @@ -/* $OpenBSD: canohost.c,v 1.56 2006/07/11 20:07:25 stevesk Exp $ */ +/* $OpenBSD: canohost.c,v 1.57 2006/07/12 22:28:51 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -21,6 +21,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #include "packet.h" #include "xmalloc.h" diff --git a/channels.c b/channels.c index 555067255..2021bad53 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.254 2006/07/11 20:07:25 stevesk Exp $ */ +/* $OpenBSD: channels.c,v 1.255 2006/07/12 22:28:51 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -50,6 +50,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #include #include "ssh.h" diff --git a/dns.c b/dns.c index 504b5d72e..16954a6a1 100644 --- a/dns.c +++ b/dns.c @@ -30,7 +30,9 @@ #include #include -#include +#if defined(HAVE_NETDB_H) +# include +#endif #include "xmalloc.h" #include "key.h" diff --git a/includes.h b/includes.h index 08d34486b..7a3396c16 100644 --- a/includes.h +++ b/includes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: includes.h,v 1.49 2006/07/11 20:07:25 stevesk Exp $ */ +/* $OpenBSD: includes.h,v 1.50 2006/07/12 22:28:51 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -123,9 +123,6 @@ #endif #include /* For typedefs */ -#if defined(HAVE_NETDB_H) -# include -#endif #ifdef HAVE_RPC_TYPES_H # include /* For INADDR_LOOPBACK */ #endif diff --git a/logintest.c b/logintest.c index 7e9fbbfbb..0de928bec 100644 --- a/logintest.c +++ b/logintest.c @@ -40,7 +40,9 @@ #include #include #include -#include +#if defined(HAVE_NETDB_H) +# include +#endif #ifdef HAVE_TIME_H #include #endif diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h index cbcf7f727..5c2ce5b1b 100644 --- a/openbsd-compat/fake-rfc2553.h +++ b/openbsd-compat/fake-rfc2553.h @@ -1,4 +1,4 @@ -/* $Id: fake-rfc2553.h,v 1.12 2005/08/03 05:36:21 dtucker Exp $ */ +/* $Id: fake-rfc2553.h,v 1.13 2006/07/24 03:51:52 djm Exp $ */ /* * Copyright (C) 2000-2003 Damien Miller. All rights reserved. @@ -41,7 +41,10 @@ #define _FAKE_RFC2553_H #include "includes.h" -#include "sys/types.h" +#include +#if defined(HAVE_NETDB_H) +# include +#endif /* * First, socket and INET6 related definitions diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 33be00c2b..6fd593aad 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -34,6 +34,9 @@ #ifdef _AIX #include +#if defined(HAVE_NETDB_H) +# include +#endif #include #include #include "port-aix.h" diff --git a/readconf.c b/readconf.c index d2e172303..4f790e246 100644 --- a/readconf.c +++ b/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.154 2006/07/11 20:07:25 stevesk Exp $ */ +/* $OpenBSD: readconf.c,v 1.155 2006/07/12 22:28:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -22,6 +22,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #include "ssh.h" #include "xmalloc.h" diff --git a/servconf.c b/servconf.c index 42ec340f3..20e3f1a86 100644 --- a/servconf.c +++ b/servconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: servconf.c,v 1.153 2006/07/12 11:34:58 dtucker Exp $ */ +/* $OpenBSD: servconf.c,v 1.154 2006/07/12 22:28:52 stevesk Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -15,6 +15,10 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif + #include "ssh.h" #include "log.h" #include "servconf.h" diff --git a/ssh-keygen.c b/ssh-keygen.c index 1c506059c..b217c55e8 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -23,6 +23,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #ifdef HAVE_PATHS_H # include #endif diff --git a/ssh-keyscan.c b/ssh-keyscan.c index a612dd1b9..38c37e579 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keyscan.c,v 1.66 2006/07/10 16:37:36 stevesk Exp $ */ +/* $OpenBSD: ssh-keyscan.c,v 1.67 2006/07/12 22:28:52 stevesk Exp $ */ /* * Copyright 1995, 1996 by David Mazieres . * @@ -11,12 +11,15 @@ #include "openbsd-compat/sys-queue.h" #include +#if defined(HAVE_NETDB_H) +# include +#endif #include #include +#include #include -#include #include "xmalloc.h" #include "ssh.h" #include "ssh1.h" diff --git a/ssh.c b/ssh.c index 9961baf6e..701c40543 100644 --- a/ssh.c +++ b/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.285 2006/07/11 20:27:56 stevesk Exp $ */ +/* $OpenBSD: ssh.c,v 1.286 2006/07/12 22:28:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -54,6 +54,9 @@ #include #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #ifdef HAVE_PATHS_H #include #endif diff --git a/sshconnect.c b/sshconnect.c index c9d6221d8..fe9b4842c 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.190 2006/07/11 20:07:25 stevesk Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.191 2006/07/12 22:28:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -24,6 +24,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #ifdef HAVE_PATHS_H #include #endif diff --git a/sshd.c b/sshd.c index 497525df8..3da176da1 100644 --- a/sshd.c +++ b/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.337 2006/07/12 11:34:58 dtucker Exp $ */ +/* $OpenBSD: sshd.c,v 1.338 2006/07/12 22:28:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -54,6 +54,9 @@ #include #include +#if defined(HAVE_NETDB_H) +# include +#endif #ifdef HAVE_PATHS_H #include #endif -- cgit v1.2.3 From b8fe89c4d97ea9a5d7efb2c60108b8a7644f6a49 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 24 Jul 2006 14:51:00 +1000 Subject: - (djm) [acss.c auth-krb5.c auth-options.c auth-pam.c auth-shadow.c] [canohost.c channels.c cipher-acss.c defines.h dns.c gss-genr.c] [gss-serv-krb5.c gss-serv.c log.h loginrec.c logintest.c readconf.c] [servconf.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c ssh-rand-helper.c] [ssh.c sshconnect.c sshd.c openbsd-compat/bindresvport.c] [openbsd-compat/bsd-arc4random.c openbsd-compat/bsd-misc.c] [openbsd-compat/getrrsetbyname.c openbsd-compat/glob.c] [openbsd-compat/mktemp.c openbsd-compat/port-linux.c] [openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c] [openbsd-compat/setproctitle.c openbsd-compat/xmmap.c] make the portable tree compile again - sprinkle unistd.h and string.h back in. Don't redefine __unused, as it turned out to be used in headers on Linux, and replace its use in auth-pam.c with ARGSUSED --- ChangeLog | 15 ++++++++++++++- acss.c | 5 ++++- auth-krb5.c | 2 ++ auth-options.c | 4 +--- auth-pam.c | 11 ++++++++--- auth-shadow.c | 1 + canohost.c | 4 +--- channels.c | 4 +--- cipher-acss.c | 3 +++ defines.h | 7 +------ dns.c | 4 +--- gss-genr.c | 1 + gss-serv-krb5.c | 2 ++ gss-serv.c | 1 + log.h | 2 ++ loginrec.c | 2 ++ logintest.c | 4 +--- openbsd-compat/bindresvport.c | 1 + openbsd-compat/bsd-arc4random.c | 4 ++++ openbsd-compat/bsd-misc.c | 1 + openbsd-compat/getrrsetbyname.c | 2 ++ openbsd-compat/glob.c | 2 ++ openbsd-compat/mktemp.c | 1 + openbsd-compat/port-linux.c | 5 ++++- openbsd-compat/port-tun.c | 2 ++ openbsd-compat/readpassphrase.c | 2 ++ openbsd-compat/setproctitle.c | 1 + openbsd-compat/xmmap.c | 4 +++- readconf.c | 4 +--- servconf.c | 4 +--- ssh-keygen.c | 4 +--- ssh-keyscan.c | 4 +--- ssh-keysign.c | 2 +- ssh-rand-helper.c | 2 ++ ssh.c | 4 +--- sshconnect.c | 4 +--- sshd.c | 4 +--- 37 files changed, 79 insertions(+), 50 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 7f7679402..d2cd9b597 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,19 @@ [auth.h dispatch.c kex.h sftp-client.c] #include for sig_atomic_t; need this prior to move + - (djm) [acss.c auth-krb5.c auth-options.c auth-pam.c auth-shadow.c] + [canohost.c channels.c cipher-acss.c defines.h dns.c gss-genr.c] + [gss-serv-krb5.c gss-serv.c log.h loginrec.c logintest.c readconf.c] + [servconf.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c ssh-rand-helper.c] + [ssh.c sshconnect.c sshd.c openbsd-compat/bindresvport.c] + [openbsd-compat/bsd-arc4random.c openbsd-compat/bsd-misc.c] + [openbsd-compat/getrrsetbyname.c openbsd-compat/glob.c] + [openbsd-compat/mktemp.c openbsd-compat/port-linux.c] + [openbsd-compat/port-tun.c openbsd-compat/readpassphrase.c] + [openbsd-compat/setproctitle.c openbsd-compat/xmmap.c] + make the portable tree compile again - sprinkle unistd.h and string.h + back in. Don't redefine __unused, as it turned out to be used in + headers on Linux, and replace its use in auth-pam.c with ARGSUSED 20060713 - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h @@ -5017,4 +5030,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4429 2006/07/24 04:14:19 djm Exp $ +$Id: ChangeLog,v 1.4430 2006/07/24 04:51:00 djm Exp $ diff --git a/acss.c b/acss.c index 99efde071..86e2c01a8 100644 --- a/acss.c +++ b/acss.c @@ -1,4 +1,4 @@ -/* $Id: acss.c,v 1.3 2005/07/17 07:04:47 djm Exp $ */ +/* $Id: acss.c,v 1.4 2006/07/24 04:51:01 djm Exp $ */ /* * Copyright (c) 2004 The OpenBSD project * @@ -16,6 +16,9 @@ */ #include "includes.h" + +#include + #include #if !defined(EVP_CTRL_SET_ACSS_MODE) && (OPENSSL_VERSION_NUMBER >= 0x00906000L) diff --git a/auth-krb5.c b/auth-krb5.c index 8beacc0d4..676b8ab1f 100644 --- a/auth-krb5.c +++ b/auth-krb5.c @@ -41,6 +41,8 @@ #ifdef KRB5 #include +#include +#include #include extern ServerOptions options; diff --git a/auth-options.c b/auth-options.c index 33c62641b..cd904967a 100644 --- a/auth-options.c +++ b/auth-options.c @@ -14,9 +14,7 @@ #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include diff --git a/auth-pam.c b/auth-pam.c index cb8754ec7..6ce9db12b 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -54,6 +54,8 @@ #include #include +#include +#include #ifdef USE_PAM #if defined(HAVE_SECURITY_PAM_APPL_H) @@ -152,14 +154,16 @@ sshpam_sigchld_handler(int sig) fatal("PAM: authentication thread exited uncleanly"); } +/* ARGSUSED */ static void -pthread_exit(void *value __unused) +pthread_exit(void *value) { _exit(0); } +/* ARGSUSED */ static int -pthread_create(sp_pthread_t *thread, const void *attr __unused, +pthread_create(sp_pthread_t *thread, const void *attr, void *(*thread_start)(void *), void *arg) { pid_t pid; @@ -191,8 +195,9 @@ pthread_cancel(sp_pthread_t thread) return (kill(thread, SIGTERM)); } +/* ARGSUSED */ static int -pthread_join(sp_pthread_t thread, void **value __unused) +pthread_join(sp_pthread_t thread, void **value) { int status; diff --git a/auth-shadow.c b/auth-shadow.c index c8d5dd3c1..7cd69c21f 100644 --- a/auth-shadow.c +++ b/auth-shadow.c @@ -26,6 +26,7 @@ #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) #include +#include #include "auth.h" #include "buffer.h" diff --git a/canohost.c b/canohost.c index 97b5a78f9..b40cbf603 100644 --- a/canohost.c +++ b/canohost.c @@ -21,9 +21,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include "packet.h" diff --git a/channels.c b/channels.c index 8cf4242fe..895c43f6a 100644 --- a/channels.c +++ b/channels.c @@ -50,9 +50,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include #include diff --git a/cipher-acss.c b/cipher-acss.c index 90b51a4d1..cb0bf736c 100644 --- a/cipher-acss.c +++ b/cipher-acss.c @@ -15,8 +15,11 @@ */ #include "includes.h" + #include +#include + #if !defined(EVP_CTRL_SET_ACSS_MODE) && (OPENSSL_VERSION_NUMBER >= 0x00907000L) #include "acss.h" diff --git a/defines.h b/defines.h index 4dccc9172..7b0a302a5 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.133 2006/07/12 04:14:31 dtucker Exp $ */ +/* $Id: defines.h,v 1.134 2006/07/24 04:51:01 djm Exp $ */ /* Constants */ @@ -143,16 +143,11 @@ including rpc/rpc.h breaks Solaris 6 #define INADDR_LOOPBACK ((u_long)0x7f000001) #endif -#ifndef __unused -#define __unused -#endif - /* Types */ /* If sys/types.h does not supply intXX_t, supply them ourselves */ /* (or die trying) */ - #ifndef HAVE_U_INT typedef unsigned int u_int; #endif diff --git a/dns.c b/dns.c index 5f123a2ee..c9368b96b 100644 --- a/dns.c +++ b/dns.c @@ -30,9 +30,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include "xmalloc.h" diff --git a/gss-genr.c b/gss-genr.c index 0497657c0..522fedab3 100644 --- a/gss-genr.c +++ b/gss-genr.c @@ -29,6 +29,7 @@ #ifdef GSSAPI #include +#include #include "xmalloc.h" #include "bufaux.h" diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c index eae29b2ae..7b78cfe0a 100644 --- a/gss-serv-krb5.c +++ b/gss-serv-krb5.c @@ -29,6 +29,8 @@ #ifdef GSSAPI #ifdef KRB5 +#include + #include "auth.h" #include "xmalloc.h" #include "log.h" diff --git a/gss-serv.c b/gss-serv.c index c033aad4f..b5c5538fe 100644 --- a/gss-serv.c +++ b/gss-serv.c @@ -29,6 +29,7 @@ #ifdef GSSAPI #include +#include #include "bufaux.h" #include "auth.h" diff --git a/log.h b/log.h index 9e1a2fcdb..15ebc93b5 100644 --- a/log.h +++ b/log.h @@ -15,6 +15,8 @@ #ifndef SSH_LOG_H #define SSH_LOG_H +#include "includes.h" + #include #include /* Needed for LOG_AUTHPRIV (if present) */ diff --git a/loginrec.c b/loginrec.c index 8299b79e4..955d42e8f 100644 --- a/loginrec.c +++ b/loginrec.c @@ -156,6 +156,8 @@ #include #include #include +#include +#include #include "ssh.h" #include "xmalloc.h" diff --git a/logintest.c b/logintest.c index 0de928bec..7e9fbbfbb 100644 --- a/logintest.c +++ b/logintest.c @@ -40,9 +40,7 @@ #include #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #ifdef HAVE_TIME_H #include #endif diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index 2c16233c9..ef0eff3b6 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -37,6 +37,7 @@ #include "includes.h" #include +#include #define STARTPORT 600 #define ENDPORT (IPPORT_RESERVED - 1) diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c index 46e0a020f..c1aecfe99 100644 --- a/openbsd-compat/bsd-arc4random.c +++ b/openbsd-compat/bsd-arc4random.c @@ -15,6 +15,10 @@ */ #include "includes.h" + +#include +#include + #include "log.h" #ifndef HAVE_ARC4RANDOM diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index d2d9ad771..e6128f9a7 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -17,6 +17,7 @@ #include "includes.h" +#include #include #include "xmalloc.h" diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index a855ad6d5..70ef1850d 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -49,6 +49,8 @@ #ifndef HAVE_GETRRSETBYNAME +#include + #include "getrrsetbyname.h" #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index bba4c0976..b4873932a 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -41,6 +41,8 @@ #include #include #include +#include +#include static long get_arg_max(void) diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index b8b0793a6..2285c84df 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -41,6 +41,7 @@ #include #include #include +#include #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index 54ec2910e..5e2e878dc 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c @@ -1,4 +1,4 @@ -/* $Id: port-linux.c,v 1.1 2006/04/22 11:26:08 djm Exp $ */ +/* $Id: port-linux.c,v 1.2 2006/07/24 04:51:01 djm Exp $ */ /* * Copyright (c) 2005 Daniel Walsh @@ -23,6 +23,9 @@ #include "includes.h" +#include +#include + #ifdef WITH_SELINUX #include "log.h" #include "port-linux.h" diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index 9806eec7d..f6a6aa9e1 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -23,6 +23,8 @@ #include #include +#include +#include #include "log.h" #include "misc.h" diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index fd9731ac6..11bd8f646 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include #ifdef TCSASOFT # define _T_FLUSH (TCSAFLUSH|TCSASOFT) diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index 32e987deb..7fec73f89 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c @@ -40,6 +40,7 @@ #ifdef HAVE_SYS_PSTAT_H #include #endif +#include #define SPT_NONE 0 /* don't use it at all */ #define SPT_PSTAT 1 /* use pstat(PSTAT_SETCMD, ...) */ diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 7d5cc812c..1293dcab0 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.8 2006/07/12 12:35:52 dtucker Exp $ */ +/* $Id: xmmap.c,v 1.9 2006/07/24 04:51:01 djm Exp $ */ #include "includes.h" @@ -34,6 +34,8 @@ #include #include +#include +#include #include "log.h" diff --git a/readconf.c b/readconf.c index 432b80ed0..6fe372796 100644 --- a/readconf.c +++ b/readconf.c @@ -22,9 +22,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include diff --git a/servconf.c b/servconf.c index ce44b5f60..dca9508ab 100644 --- a/servconf.c +++ b/servconf.c @@ -15,9 +15,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include diff --git a/ssh-keygen.c b/ssh-keygen.c index f2d37129b..17236a55a 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -23,9 +23,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #ifdef HAVE_PATHS_H # include #endif diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 30df75166..6b706f0af 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -14,9 +14,7 @@ #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #include #include #include diff --git a/ssh-keysign.c b/ssh-keysign.c index 435b839fa..89b8e4342 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -148,7 +148,7 @@ main(int argc, char **argv) { Buffer b; Options options; - Key *keys[2], *key; + Key *keys[2], *key = NULL; struct passwd *pw; int key_fd[2], i, found, version = 2, fd; u_char *signature, *data; diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index fb6fc2814..121fa52fa 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include diff --git a/ssh.c b/ssh.c index d0d9457c2..df787e45f 100644 --- a/ssh.c +++ b/ssh.c @@ -54,9 +54,7 @@ #include #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #ifdef HAVE_PATHS_H #include #endif diff --git a/sshconnect.c b/sshconnect.c index f33cf52b1..21c5203c6 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -24,9 +24,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #ifdef HAVE_PATHS_H #include #endif diff --git a/sshd.c b/sshd.c index 6428f42a0..cc1ebd8d9 100644 --- a/sshd.c +++ b/sshd.c @@ -54,9 +54,7 @@ #include #include -#if defined(HAVE_NETDB_H) -# include -#endif +#include #ifdef HAVE_PATHS_H #include #endif -- cgit v1.2.3 From 8b373baf13f9bec712ad01a0242241bc6529f5f4 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 24 Jul 2006 14:55:47 +1000 Subject: - (djm) [openbsd-compat/glob.c] Move get_arg_max() into the ifdef HAVE_GLOB block so that it compiles on OpenBSD (or other platforms with a decent glob implementation) with -Werror --- ChangeLog | 6 +++++- openbsd-compat/glob.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index d2cd9b597..be85b0c52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -112,6 +112,10 @@ make the portable tree compile again - sprinkle unistd.h and string.h back in. Don't redefine __unused, as it turned out to be used in headers on Linux, and replace its use in auth-pam.c with ARGSUSED + - (djm) [openbsd-compat/glob.c] + Move get_arg_max() into the ifdef HAVE_GLOB block so that it compiles + on OpenBSD (or other platforms with a decent glob implementation) with + -Werror 20060713 - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h @@ -5030,4 +5034,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4430 2006/07/24 04:51:00 djm Exp $ +$Id: ChangeLog,v 1.4431 2006/07/24 04:55:47 djm Exp $ diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index b4873932a..907235353 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -44,6 +44,9 @@ #include #include +#if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || \ + !defined(GLOB_HAS_GL_MATCHC) + static long get_arg_max(void) { @@ -56,9 +59,6 @@ get_arg_max(void) #endif } -#if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) - /* * glob(3) -- a superset of the one defined in POSIX 1003.2. * -- cgit v1.2.3 From 62da44f0644f5d1cc7fa3b6b967482b5d2f15aa2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 24 Jul 2006 15:08:35 +1000 Subject: - (djm) [openbsd-compat/basename.c openbsd-compat/bsd-closefrom.c] [openbsd-compat/bsd-cray.c openbsd-compat/bsd-openpty.c] [openbsd-compat/bsd-snprintf.c openbsd-compat/fake-rfc2553.c] [openbsd-compat/port-aix.c openbsd-compat/port-irix.c] [openbsd-compat/rresvport.c] These look to need string.h and/or unistd.h (based on a grep for function names) --- ChangeLog | 11 +++++++++-- openbsd-compat/basename.c | 1 + openbsd-compat/bsd-closefrom.c | 2 ++ openbsd-compat/bsd-cray.c | 4 +++- openbsd-compat/bsd-openpty.c | 2 ++ openbsd-compat/bsd-snprintf.c | 2 ++ openbsd-compat/fake-rfc2553.c | 1 + openbsd-compat/port-aix.c | 2 ++ openbsd-compat/port-irix.c | 3 +++ openbsd-compat/rresvport.c | 1 + 10 files changed, 26 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index aa3d0ae9b..9e9ecfa6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -122,7 +122,14 @@ - (djm) [session.c] fix compile error with -Werror -Wall: 'path' is only used in do_setup_env() if HAVE_LOGIN_CAP is not defined - + - (djm) [openbsd-compat/basename.c openbsd-compat/bsd-closefrom.c] + [openbsd-compat/bsd-cray.c openbsd-compat/bsd-openpty.c] + [openbsd-compat/bsd-snprintf.c openbsd-compat/fake-rfc2553.c] + [openbsd-compat/port-aix.c openbsd-compat/port-irix.c] + [openbsd-compat/rresvport.c] + These look to need string.h and/or unistd.h (based on a grep for function + names) + 20060713 - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h @@ -5040,4 +5047,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4433 2006/07/24 05:03:06 djm Exp $ +$Id: ChangeLog,v 1.4434 2006/07/24 05:08:35 djm Exp $ diff --git a/openbsd-compat/basename.c b/openbsd-compat/basename.c index ad040e139..4b10cb84b 100644 --- a/openbsd-compat/basename.c +++ b/openbsd-compat/basename.c @@ -20,6 +20,7 @@ #include "includes.h" #ifndef HAVE_BASENAME +#include char * basename(const char *path) diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 7509d2835..3f17302d1 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index d1f1c059c..8093f6d54 100644 --- a/openbsd-compat/bsd-cray.c +++ b/openbsd-compat/bsd-cray.c @@ -1,5 +1,5 @@ /* - * $Id: bsd-cray.c,v 1.14 2005/02/02 06:10:11 dtucker Exp $ + * $Id: bsd-cray.c,v 1.15 2006/07/24 05:08:36 djm Exp $ * * bsd-cray.c * @@ -53,6 +53,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index 0b77a1da9..a2f2fda60 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -57,6 +57,8 @@ #endif #include +#include +#include #ifndef O_NOCTTY #define O_NOCTTY 0 diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index c30cd1223..9fdf4d3f0 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -108,6 +108,8 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#include + #ifdef HAVE_LONG_DOUBLE # define LDOUBLE long double #else diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index aae016bf7..08a7cb66c 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -36,6 +36,7 @@ */ #include "includes.h" +#include #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 6fd593aad..2d56e7e4a 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -38,6 +38,8 @@ # include #endif #include +#include +#include #include #include "port-aix.h" diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c index aa6db1cf8..eaa91a4b5 100644 --- a/openbsd-compat/port-irix.c +++ b/openbsd-compat/port-irix.c @@ -29,6 +29,9 @@ defined(WITH_IRIX_JOBS) || \ defined(WITH_IRIX_ARRAY) +#include +#include + #ifdef WITH_IRIX_PROJECT # include #endif /* WITH_IRIX_PROJECT */ diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index fc029f46f..c10391872 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -36,6 +36,7 @@ #ifndef HAVE_RRESVPORT_AF #include +#include #if 0 int -- cgit v1.2.3 From 94346f85967e54ceec7b643eb7e74f4814fd75d7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 25 Jul 2006 19:52:07 +1000 Subject: - (dtucker) [openbsd-compat/xmmap.c] Need fcntl.h for O_RDRW. --- ChangeLog | 5 ++++- openbsd-compat/xmmap.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 77af8bef7..d4a4e7b6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060725 + - (dtucker) [openbsd-compat/xmmap.c] Need fcntl.h for O_RDRW. + 20060724 - (djm) OpenBSD CVS Sync - jmc@cvs.openbsd.org 2006/07/12 13:39:55 @@ -5056,4 +5059,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4438 2006/07/24 13:50:23 dtucker Exp $ +$Id: ChangeLog,v 1.4439 2006/07/25 09:52:07 dtucker Exp $ diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 1293dcab0..6a1708e5d 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.9 2006/07/24 04:51:01 djm Exp $ */ +/* $Id: xmmap.c,v 1.10 2006/07/25 09:52:08 dtucker Exp $ */ #include "includes.h" @@ -32,6 +32,9 @@ #include #endif #include +#ifdef HAVE_FCNTL_H +# include +#endif #include #include -- cgit v1.2.3 From 88fdc83d4c56340fb4d39557fcd2d6fb55cb6f30 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 2 Aug 2006 23:33:54 +1000 Subject: - (dtucker) [openbsd-compat/daemon.c] Add unistd.h for fork() prototype. --- ChangeLog | 5 ++++- openbsd-compat/daemon.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index d4a4e7b6c..128057cbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060802 + - (dtucker) [openbsd-compat/daemon.c] Add unistd.h for fork() prototype. + 20060725 - (dtucker) [openbsd-compat/xmmap.c] Need fcntl.h for O_RDRW. @@ -5059,4 +5062,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4439 2006/07/25 09:52:07 dtucker Exp $ +$Id: ChangeLog,v 1.4440 2006/08/02 13:33:54 dtucker Exp $ diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c index f380139d3..e3a6886bd 100644 --- a/openbsd-compat/daemon.c +++ b/openbsd-compat/daemon.c @@ -44,6 +44,10 @@ # include #endif +#ifdef HAVE_UNISTD_H +# include +#endif + int daemon(int nochdir, int noclose) { -- cgit v1.2.3 From d783435315d8e604998925d5e47b663a500ed252 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 12:39:39 +1000 Subject: - 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") --- ChangeLog | 30 +++++++++++++++++++++++++++++- OVERVIEW | 3 +-- atomicio.c | 3 ++- atomicio.h | 7 +------ auth-bsdauth.c | 11 ++++++++++- auth-chall.c | 8 ++++++-- auth-krb5.c | 11 +++++++++-- auth-options.c | 12 ++++++++++-- auth-options.h | 6 +----- auth-passwd.c | 5 ++++- auth-rh-rsa.c | 8 ++++++-- auth-rhosts.c | 6 +++++- auth-rsa.c | 11 ++++++++--- auth-skey.c | 5 ++++- auth.c | 10 +++++++--- auth.h | 11 +---------- auth1.c | 8 +++++++- auth2-chall.c | 9 +++++++-- auth2-gss.c | 14 +++++++------- auth2-hostbased.c | 12 ++++++++---- auth2-kbdint.c | 9 +++++++-- auth2-none.c | 10 ++++++++-- auth2-passwd.c | 11 ++++++++++- auth2-pubkey.c | 12 ++++++++---- auth2.c | 10 +++++++--- authfd.c | 7 ++++--- authfd.h | 4 +--- authfile.c | 6 +++--- bufaux.c | 7 +++++-- bufbn.c | 7 +++++-- buffer.c | 3 ++- buffer.h | 38 +++++++++++++++++++++++++++++++++++++- canohost.c | 5 +++-- channels.c | 9 +++++---- channels.h | 4 +--- cipher-3des1.c | 4 +++- cipher-bf1.c | 4 +++- cipher-ctr.c | 6 ++++-- cipher.c | 5 ++++- cleanup.c | 5 ++++- clientloop.c | 8 ++++---- compat.c | 7 +++++-- compress.c | 6 +++++- deattack.c | 8 ++++++-- dh.c | 2 +- dispatch.c | 6 +++++- dns.c | 2 +- dns.h | 9 +-------- fatal.c | 4 +++- groupaccess.c | 5 +++-- groupaccess.h | 4 +--- gss-genr.c | 6 ++++-- gss-serv-krb5.c | 9 +++++++-- gss-serv.c | 10 +++++++--- hostfile.c | 4 ++-- includes.h | 3 --- kex.c | 12 ++++++------ kex.h | 8 +------- kexdh.c | 9 +++++++-- kexdhc.c | 7 ++++++- kexdhs.c | 9 ++++++++- kexgex.c | 8 ++++++-- kexgexc.c | 7 ++++++- kexgexs.c | 8 +++++++- key.c | 6 ++++-- key.h | 4 +--- log.c | 6 ++++-- log.h | 8 +------- loginrec.c | 4 +++- loginrec.h | 4 ---- mac.c | 7 ++++++- match.c | 6 ++++-- md-sha256.c | 4 +++- misc.c | 6 +++--- misc.h | 7 +------ moduli.c | 3 ++- monitor.c | 15 ++++++++++----- monitor_fdpass.c | 3 ++- monitor_mm.c | 7 +++++-- monitor_mm.h | 3 +-- monitor_wrap.c | 25 +++++++++++++------------ monitor_wrap.h | 10 +--------- msg.c | 6 +++++- nchan.c | 3 ++- openbsd-compat/port-aix.c | 7 +++++-- openbsd-compat/port-tun.h | 2 -- packet.c | 8 +++----- progressmeter.c | 3 ++- readconf.c | 7 +++++-- readconf.h | 4 +--- readpass.c | 2 +- rsa.c | 6 ++++-- scard.c | 8 +++++--- scard.h | 4 +--- scp.c | 3 ++- servconf.c | 8 ++++++-- servconf.h | 4 +--- serverloop.c | 8 ++++++-- session.c | 15 ++++++++------- session.h | 6 +----- sftp-client.c | 12 ++++++------ sftp-common.c | 6 +++--- sftp-common.h | 7 +------ sftp-glob.c | 4 ++-- sftp-server.c | 12 +++++++----- sftp.c | 6 ++++-- ssh-add.c | 5 +++-- ssh-agent.c | 5 ++--- ssh-dss.c | 5 +++-- ssh-gss.h | 4 +--- ssh-keygen.c | 3 +-- ssh-keyscan.c | 7 ++++--- ssh-keysign.c | 6 +++--- ssh-rsa.c | 6 ++++-- ssh.c | 7 +++---- ssh.h | 16 +--------------- sshconnect.c | 6 ++++-- sshconnect.h | 11 +---------- sshconnect1.c | 14 ++++++++++---- sshconnect2.c | 9 ++++++--- sshd.c | 18 +++++++++++------- sshlogin.c | 4 +++- sshlogin.h | 9 +-------- sshpty.c | 7 ++++--- sshpty.h | 10 +--------- sshtty.c | 4 +++- ttymodes.c | 6 ++++-- uidswap.c | 5 ++--- uidswap.h | 11 +---------- uuencode.c | 4 +--- uuencode.h | 8 +------- xmalloc.c | 3 +-- xmalloc.h | 7 +------ 133 files changed, 584 insertions(+), 412 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index b955ea8a4..7f48d236e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,34 @@ - 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 @@ -5124,4 +5152,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4451 2006/08/05 01:38:40 djm Exp $ +$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. - 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 $ diff --git a/atomicio.c b/atomicio.c index 4ff990fd3..f651a292c 100644 --- a/atomicio.c +++ b/atomicio.c @@ -1,4 +1,4 @@ -/* $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. @@ -29,6 +29,7 @@ #include "includes.h" #include +#include #include #include diff --git a/atomicio.h b/atomicio.h index 05b97ab8b..2fcd25d43 100644 --- a/atomicio.h +++ b/atomicio.h @@ -1,4 +1,4 @@ -/* $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. @@ -29,11 +29,6 @@ #ifndef _ATOMICIO_H #define _ATOMICIO_H -#include -#include - -#include - /* * Ensure all of data on socket comes through. f==read || f==vwrite */ 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 @@ -/* $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. * @@ -22,12 +22,21 @@ * (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 + #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 * 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 @@ -/* $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. * @@ -25,9 +25,13 @@ #include "includes.h" +#include + +#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 */ 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 @@ -/* $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. * @@ -30,13 +30,20 @@ #include "includes.h" +#include +#include +#include + +#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 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -17,17 +17,25 @@ #include #include #include +#include +#include #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; 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 @@ -/* $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 @@ -15,10 +15,6 @@ #ifndef AUTH_OPTIONS_H #define AUTH_OPTIONS_H -#include - -#include - /* Linked list of custom environment strings */ struct envstring { 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -43,11 +43,14 @@ #include #include #include +#include #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" 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -18,17 +18,21 @@ #include #include +#include #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 */ 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -25,13 +25,17 @@ #include #include #include +#include #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 */ 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -26,18 +26,23 @@ #include #include +#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" 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 @@ -/* $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. * @@ -22,10 +22,13 @@ * (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 + #include #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 @@ -/* $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. * @@ -51,17 +51,21 @@ #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 */ diff --git a/auth.h b/auth.h index 2c7499573..26158b9dd 100644 --- a/auth.h +++ b/auth.h @@ -1,4 +1,4 @@ -/* $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. @@ -28,14 +28,8 @@ #ifndef AUTH_H #define AUTH_H -#include - -#include -#include #include -#include -#include "buffer.h" #include #ifdef HAVE_LOGIN_CAP @@ -48,9 +42,6 @@ #include #endif -#include "key.h" -#include "hostfile.h" - typedef struct Authctxt Authctxt; typedef struct Authmethod Authmethod; typedef 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 @@ -/* $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 , Espoo, Finland * All rights reserved @@ -17,6 +17,7 @@ #include #include #include +#include #include "xmalloc.h" #include "rsa.h" @@ -26,10 +27,15 @@ #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" 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 @@ -/* $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. @@ -23,16 +23,21 @@ * (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 + #include #include +#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" 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 @@ -/* $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. @@ -26,18 +26,20 @@ #include "includes.h" -#ifdef GSSAPI +#include +#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; @@ -291,5 +293,3 @@ Authmethod method_gssapi = { userauth_gssapi, &options.gss_authentication }; - -#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 @@ -/* $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. * @@ -29,18 +29,22 @@ #include #include +#include -#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" 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 @@ -/* $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. * @@ -25,11 +25,16 @@ #include "includes.h" +#include + +#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; 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 @@ -/* $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. * @@ -30,14 +30,20 @@ #include -#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 */ 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 @@ -/* $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. * @@ -25,12 +25,21 @@ #include "includes.h" +#include + #include +#include #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" 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 @@ -/* $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. * @@ -30,22 +30,26 @@ #include #include +#include +#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" diff --git a/auth2.c b/auth2.c index 83d5224c9..2d880b57c 100644 --- a/auth2.c +++ b/auth2.c @@ -1,4 +1,4 @@ -/* $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. * @@ -28,23 +28,27 @@ #include #include +#include #include -#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; diff --git a/authfd.c b/authfd.c index f8ee8051d..5c910df13 100644 --- a/authfd.c +++ b/authfd.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -43,16 +43,17 @@ #include +#include #include #include +#include #include #include +#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" diff --git a/authfd.h b/authfd.h index 8ad8f2e71..3da256112 100644 --- a/authfd.h +++ b/authfd.h @@ -1,4 +1,4 @@ -/* $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 @@ -16,8 +16,6 @@ #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 diff --git a/authfile.c b/authfile.c index 400e60b39..675085646 100644 --- a/authfile.c +++ b/authfile.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -53,10 +54,9 @@ #include #include -#include "cipher.h" #include "xmalloc.h" +#include "cipher.h" #include "buffer.h" -#include "bufaux.h" #include "key.h" #include "ssh.h" #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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -39,12 +39,15 @@ #include "includes.h" +#include + #include #include +#include -#include "bufaux.h" #include "xmalloc.h" +#include "buffer.h" #include "log.h" #include "misc.h" diff --git a/bufbn.c b/bufbn.c index aa42ea62b..6cf65d372 100644 --- a/bufbn.c +++ b/bufbn.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -39,12 +39,15 @@ #include "includes.h" +#include + #include #include +#include -#include "bufaux.h" #include "xmalloc.h" +#include "buffer.h" #include "log.h" #include "misc.h" diff --git a/buffer.c b/buffer.c index 25868b94d..e02e1e35c 100644 --- a/buffer.c +++ b/buffer.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -18,6 +18,7 @@ #include #include +#include #include "xmalloc.h" #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 @@ -/* $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 @@ -46,4 +46,40 @@ int buffer_get_ret(Buffer *, void *, u_int); int buffer_consume_ret(Buffer *, u_int); int buffer_consume_end_ret(Buffer *, u_int); +#include + +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 */ diff --git a/canohost.c b/canohost.c index c236617d7..dd3972e8d 100644 --- a/canohost.c +++ b/canohost.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -25,9 +25,10 @@ #include #include #include +#include -#include "packet.h" #include "xmalloc.h" +#include "packet.h" #include "log.h" #include "canohost.h" diff --git a/channels.c b/channels.c index fb4d287d6..dfa1e591b 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -41,8 +41,8 @@ #include "includes.h" -#include #include +#include #include #include #ifdef HAVE_SYS_TIME_H @@ -59,21 +59,22 @@ #include #include #include +#include +#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 */ diff --git a/channels.h b/channels.h index ed719f724..2674f096e 100644 --- a/channels.h +++ b/channels.h @@ -1,4 +1,4 @@ -/* $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 @@ -38,8 +38,6 @@ #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. */ 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 @@ -/* $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. * @@ -25,6 +25,8 @@ #include "includes.h" +#include + #include #include 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 @@ -/* $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. * @@ -25,6 +25,8 @@ #include "includes.h" +#include + #include #include 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 @@ -/* $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 * @@ -16,12 +16,14 @@ */ #include "includes.h" +#include + #include #include -#include "log.h" #include "xmalloc.h" +#include "log.h" /* compatibility with old or broken OpenSSL versions */ #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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,9 +37,12 @@ #include "includes.h" +#include + #include #include +#include #include "xmalloc.h" #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 @@ -/* $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 * @@ -17,7 +17,10 @@ #include "config.h" +#include + #include +#include #include "log.h" diff --git a/clientloop.c b/clientloop.c index f9ffa2bb7..132d75a44 100644 --- a/clientloop.c +++ b/clientloop.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -82,20 +82,20 @@ #include #include #include +#include #include +#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" diff --git a/compat.c b/compat.c index e1a8b2bfd..da67f9410 100644 --- a/compat.c +++ b/compat.c @@ -1,4 +1,4 @@ -/* $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. * @@ -25,12 +25,15 @@ #include "includes.h" +#include + #include #include +#include +#include "xmalloc.h" #include "buffer.h" #include "packet.h" -#include "xmalloc.h" #include "compat.h" #include "log.h" #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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -14,6 +14,10 @@ #include "includes.h" +#include + +#include + #include "log.h" #include "buffer.h" #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 @@ -/* $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 * @@ -20,12 +20,16 @@ #include "includes.h" +#include + #include +#include +#include +#include "xmalloc.h" #include "deattack.h" #include "log.h" #include "crc32.h" -#include "xmalloc.h" #include "misc.h" /* SSH Constants */ diff --git a/dh.c b/dh.c index 4ca949138..925eedddf 100644 --- a/dh.c +++ b/dh.c @@ -1,4 +1,4 @@ -/* $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. * diff --git a/dispatch.c b/dispatch.c index c1d98a78e..d6b63be4b 100644 --- a/dispatch.c +++ b/dispatch.c @@ -1,4 +1,4 @@ -/* $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. * @@ -22,9 +22,13 @@ * (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 + #include +#include #include "ssh1.h" #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 @@ -/* $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. diff --git a/dns.h b/dns.h index 8f9601824..b2633a1fe 100644 --- a/dns.h +++ b/dns.h @@ -1,4 +1,4 @@ -/* $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. @@ -25,13 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "includes.h" - -#include -#include - -#include - #ifndef DNS_H #define DNS_H diff --git a/fatal.c b/fatal.c index 1f2cd0bc8..5e5aa3fe1 100644 --- a/fatal.c +++ b/fatal.c @@ -1,4 +1,4 @@ -/* $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. * @@ -25,6 +25,8 @@ #include "includes.h" +#include + #include #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 @@ -/* $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. * @@ -30,9 +30,10 @@ #include #include +#include -#include "groupaccess.h" #include "xmalloc.h" +#include "groupaccess.h" #include "match.h" #include "log.h" diff --git a/groupaccess.h b/groupaccess.h index b0baccfbf..04b449894 100644 --- a/groupaccess.h +++ b/groupaccess.h @@ -1,4 +1,4 @@ -/* $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. @@ -27,8 +27,6 @@ #ifndef GROUPACCESS_H #define GROUPACCESS_H -#include - int ga_init(const char *, gid_t); int ga_match(char * const *, int); void 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 @@ -/* $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. @@ -28,13 +28,15 @@ #ifdef GSSAPI +#include #include +#include #include #include #include "xmalloc.h" -#include "bufaux.h" +#include "buffer.h" #include "log.h" #include "ssh2.h" 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 @@ -/* $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. @@ -29,13 +29,18 @@ #ifdef GSSAPI #ifdef KRB5 +#include + #include -#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; 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 @@ -/* $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. @@ -28,15 +28,19 @@ #ifdef GSSAPI +#include + #include #include -#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" diff --git a/hostfile.c b/hostfile.c index 7ac69e776..08ba44264 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -50,11 +50,11 @@ #include #include +#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) diff --git a/includes.h b/includes.h index 9b6a63fb3..8e600567d 100644 --- a/includes.h +++ b/includes.h @@ -25,9 +25,6 @@ #ifdef HAVE_LIMITS_H # include /* For PATH_MAX */ #endif -#ifdef HAVE_GETOPT_H -# include -#endif #ifdef HAVE_BSTRING_H # include #endif diff --git a/kex.c b/kex.c index 3525307c3..0c36519a1 100644 --- a/kex.c +++ b/kex.c @@ -1,4 +1,4 @@ -/* $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. * @@ -27,21 +27,21 @@ #include -#include - +#include #include #include #include -#include "ssh2.h" +#include + #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" diff --git a/kex.h b/kex.h index a48c5c885..b1b20f500 100644 --- a/kex.h +++ b/kex.h @@ -1,4 +1,4 @@ -/* $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. @@ -29,12 +29,6 @@ #include #include -#include - -#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" diff --git a/kexdh.c b/kexdh.c index 2d13127b8..56e22f5bc 100644 --- a/kexdh.c +++ b/kexdh.c @@ -1,4 +1,4 @@ -/* $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. * @@ -25,11 +25,16 @@ #include "includes.h" +#include + +#include + #include #include "buffer.h" -#include "bufaux.h" #include "ssh2.h" +#include "key.h" +#include "cipher.h" #include "kex.h" void diff --git a/kexdhc.c b/kexdhc.c index 9d123e748..bf875ae07 100644 --- a/kexdhc.c +++ b/kexdhc.c @@ -1,4 +1,4 @@ -/* $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. * @@ -25,11 +25,16 @@ #include "includes.h" +#include + #include #include +#include #include "xmalloc.h" +#include "buffer.h" #include "key.h" +#include "cipher.h" #include "kex.h" #include "log.h" #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 @@ -/* $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. * @@ -25,15 +25,22 @@ #include "includes.h" +#include #include +#include #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 diff --git a/kexgex.c b/kexgex.c index 5ab6745a3..b60ab5c53 100644 --- a/kexgex.c +++ b/kexgex.c @@ -1,4 +1,4 @@ -/* $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. @@ -26,10 +26,14 @@ #include "includes.h" +#include + #include +#include #include "buffer.h" -#include "bufaux.h" +#include "key.h" +#include "cipher.h" #include "kex.h" #include "ssh2.h" diff --git a/kexgexc.c b/kexgexc.c index 9c618ec6c..fc48880d4 100644 --- a/kexgexc.c +++ b/kexgexc.c @@ -1,4 +1,4 @@ -/* $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. @@ -26,11 +26,16 @@ #include "includes.h" +#include + #include #include +#include #include "xmalloc.h" +#include "buffer.h" #include "key.h" +#include "cipher.h" #include "kex.h" #include "log.h" #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 @@ -/* $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. @@ -30,15 +30,21 @@ #include #include +#include #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 diff --git a/key.c b/key.c index 745c474f9..40aab20ea 100644 --- a/key.c +++ b/key.c @@ -1,4 +1,4 @@ -/* $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 , Espoo, Finland @@ -32,8 +32,11 @@ * (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 + #include #include @@ -44,7 +47,6 @@ #include "rsa.h" #include "uuencode.h" #include "buffer.h" -#include "bufaux.h" #include "log.h" Key * diff --git a/key.h b/key.h index 57af279b8..6873dd793 100644 --- a/key.h +++ b/key.h @@ -1,4 +1,4 @@ -/* $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. @@ -29,8 +29,6 @@ #include #include -#include - typedef struct Key Key; enum types { KEY_RSA1, diff --git a/log.c b/log.c index 871bc2c42..6eac73743 100644 --- a/log.c +++ b/log.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,6 +36,8 @@ #include "includes.h" +#include + #include #include #include @@ -46,8 +48,8 @@ # include #endif -#include "log.h" #include "xmalloc.h" +#include "log.h" static LogLevel log_level = SYSLOG_LEVEL_INFO; static 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 @@ -/* $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 @@ -15,12 +15,6 @@ #ifndef SSH_LOG_H #define SSH_LOG_H -#include "includes.h" - -#include - -#include /* Needed for LOG_AUTHPRIV (if present) */ - /* Supported syslog facilities and levels. */ typedef enum { 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 @@ #include #include -#include "ssh.h" #include "xmalloc.h" +#include "key.h" +#include "hostfile.h" +#include "ssh.h" #include "loginrec.h" #include "log.h" #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 @@ #include "includes.h" -#include -#include -#include - /** ** you should use the login_* calls to work around platform dependencies **/ diff --git a/mac.c b/mac.c index a59e7edf1..edf9b69bd 100644 --- a/mac.c +++ b/mac.c @@ -1,4 +1,4 @@ -/* $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. * @@ -25,13 +25,18 @@ #include "includes.h" +#include + #include #include +#include #include "xmalloc.h" #include "log.h" #include "cipher.h" +#include "buffer.h" +#include "key.h" #include "kex.h" #include "mac.h" #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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,11 +37,13 @@ #include "includes.h" +#include + #include #include -#include "match.h" #include "xmalloc.h" +#include "match.h" /* * 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 @@ -/* $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 * @@ -18,6 +18,8 @@ /* EVP wrapper for SHA256 */ #include "includes.h" + +#include #include #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 @@ -/* $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. @@ -26,8 +26,8 @@ #include "includes.h" -#include #include +#include #include #include @@ -50,9 +50,9 @@ #include #endif +#include "xmalloc.h" #include "misc.h" #include "log.h" -#include "xmalloc.h" #include "ssh.h" /* 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 @@ -/* $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 @@ -15,11 +15,6 @@ #ifndef _MISC_H #define _MISC_H -#include - -#include -#include - /* misc.c */ char *chop(char *); diff --git a/moduli.c b/moduli.c index a164b4f5d..e18929bad 100644 --- a/moduli.c +++ b/moduli.c @@ -1,4 +1,4 @@ -/* $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 * Copyright 1996-1998, 2003 William Allen Simpson @@ -46,6 +46,7 @@ #include #include #include +#include #include #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 @@ -/* $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 * Copyright 2002 Markus Friedl @@ -30,6 +30,7 @@ #include #include #include +#include "openbsd-compat/sys-tree.h" #include #include @@ -48,8 +49,13 @@ #include +#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 */ @@ -70,17 +76,16 @@ #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 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 @@ -/* $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 * All rights reserved. @@ -32,6 +32,7 @@ #include #include +#include #include "log.h" #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 @@ -/* $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 * All rights reserved. @@ -26,16 +26,19 @@ #include "includes.h" +#include #ifdef HAVE_SYS_MMAN_H #include #endif #include +#include "openbsd-compat/sys-tree.h" #include +#include #include -#include "ssh.h" #include "xmalloc.h" +#include "ssh.h" #include "log.h" #include "monitor_mm.h" 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 @@ -/* $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 @@ -27,7 +27,6 @@ #ifndef _MM_H_ #define _MM_H_ -#include "openbsd-compat/sys-tree.h" struct mm_share { 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 @@ -/* $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 * Copyright 2002 Markus Friedl @@ -29,21 +29,25 @@ #include -#include -#include - #include #include +#include #include #include +#include +#include + +#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" @@ -55,21 +59,18 @@ #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[]; 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 @@ -/* $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 @@ -28,13 +28,6 @@ #ifndef _MM_WRAP_H_ #define _MM_WRAP_H_ -#include - -#include - -#include "key.h" -#include "buffer.h" - extern int use_privsep; #define PRIVSEP(x) (use_privsep ? mm_##x : x) @@ -61,7 +54,6 @@ int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); 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 *); diff --git a/msg.c b/msg.c index 322472668..cd5f98c4f 100644 --- a/msg.c +++ b/msg.c @@ -1,4 +1,4 @@ -/* $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. * @@ -22,13 +22,17 @@ * (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 +#include #include +#include #include #include +#include #include "buffer.h" #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 @@ -/* $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. * @@ -30,6 +30,7 @@ #include #include +#include #include "ssh1.h" #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 @@ * */ #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 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 @@ #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); diff --git a/packet.c b/packet.c index acf72f77e..f2e03f800 100644 --- a/packet.c +++ b/packet.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -57,22 +57,20 @@ #include #include #include +#include #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" diff --git a/progressmeter.c b/progressmeter.c index e8534fa2f..0f95222d2 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -1,4 +1,4 @@ -/* $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. * @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/readconf.c b/readconf.c index 9975c9d32..c57ea0c82 100644 --- a/readconf.c +++ b/readconf.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -23,19 +23,22 @@ #include #include #include +#include #include #include #include -#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" diff --git a/readconf.h b/readconf.h index e99b1ff25..d484f258e 100644 --- a/readconf.h +++ b/readconf.h @@ -1,4 +1,4 @@ -/* $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 @@ -16,8 +16,6 @@ #ifndef READCONF_H #define READCONF_H -#include "key.h" - /* Data structure for representing a forwarding request. */ typedef struct { diff --git a/readpass.c b/readpass.c index 8af5d444d..bd144c2e3 100644 --- a/readpass.c +++ b/readpass.c @@ -1,4 +1,4 @@ -/* $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. * diff --git a/rsa.c b/rsa.c index c656291ed..875b486c4 100644 --- a/rsa.c +++ b/rsa.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -62,11 +62,13 @@ #include "includes.h" +#include + #include +#include "xmalloc.h" #include "rsa.h" #include "log.h" -#include "xmalloc.h" void rsa_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 @@ -/* $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. * @@ -26,14 +26,16 @@ #include "includes.h" #if defined(SMARTCARD) && defined(USE_SECTOK) -#include +#include #include #include +#include + +#include "xmalloc.h" #include "key.h" #include "log.h" -#include "xmalloc.h" #include "misc.h" #include "scard.h" diff --git a/scard.h b/scard.h index 146182261..82efe4839 100644 --- a/scard.h +++ b/scard.h @@ -1,4 +1,4 @@ -/* $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. @@ -27,8 +27,6 @@ #ifndef SCARD_H #define SCARD_H -#include "key.h" - #define SCARD_ERROR_FAIL -1 #define SCARD_ERROR_NOCARD -2 #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 @@ -/* $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). @@ -82,6 +82,7 @@ # include #endif #include +#include #include #include diff --git a/servconf.c b/servconf.c index b1fc45c50..5884b95be 100644 --- a/servconf.c +++ b/servconf.c @@ -1,4 +1,4 @@ -/* $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 , Espoo, Finland * All rights reserved @@ -19,16 +19,20 @@ #include #include #include +#include #include +#include +#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" diff --git a/servconf.h b/servconf.h index 0add6518d..2593b1cd1 100644 --- a/servconf.h +++ b/servconf.h @@ -1,4 +1,4 @@ -/* $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 @@ -16,8 +16,6 @@ #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. */ diff --git a/serverloop.c b/serverloop.c index 77c4a5a27..6e5fdc2d8 100644 --- a/serverloop.c +++ b/serverloop.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -54,6 +54,7 @@ #include #include #include +#include #include "xmalloc.h" #include "packet.h" @@ -66,13 +67,16 @@ #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; diff --git a/session.c b/session.c index a6d5ad257..1d63f9f50 100644 --- a/session.c +++ b/session.c @@ -1,4 +1,4 @@ -/* $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 , Espoo, Finland * All rights reserved @@ -58,10 +58,10 @@ #include #include +#include "xmalloc.h" #include "ssh.h" #include "ssh1.h" #include "ssh2.h" -#include "xmalloc.h" #include "sshpty.h" #include "packet.h" #include "buffer.h" @@ -69,7 +69,12 @@ #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" @@ -86,10 +91,6 @@ #include #endif -#ifdef GSSAPI -#include "ssh-gss.h" -#endif - /* func */ Session *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 @@ -/* $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. @@ -26,10 +26,6 @@ #ifndef SESSION_H #define SESSION_H -#include - -#include - #define TTYSZ 64 typedef struct Session Session; struct 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 @@ -/* $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 * @@ -24,25 +24,25 @@ #include #include +#include "openbsd-compat/sys-queue.h" #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif +#include #include #include #include +#include #include #include #include -#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" @@ -82,7 +82,7 @@ send_msg(int fd, Buffer *m) 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)); 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 @@ -/* $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. @@ -35,11 +35,11 @@ #include #include #include +#include +#include "xmalloc.h" #include "buffer.h" -#include "bufaux.h" #include "log.h" -#include "xmalloc.h" #include "sftp.h" #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 @@ -/* $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. @@ -25,11 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include - -#include "buffer.h" - /* Maximum packet that we are willing to send/accept */ #define SFTP_MAX_MSG_LENGTH (256 * 1024) 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 @@ -/* $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 * @@ -26,8 +26,8 @@ #include #include "xmalloc.h" - #include "sftp.h" +#include "buffer.h" #include "sftp-common.h" #include "sftp-client.h" 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 @@ -/* $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. * @@ -14,6 +14,7 @@ * 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 @@ -30,13 +31,14 @@ #include #include #include +#include #include #include +#include +#include "xmalloc.h" #include "buffer.h" -#include "bufaux.h" #include "log.h" -#include "xmalloc.h" #include "misc.h" #include "uidswap.h" @@ -135,7 +137,7 @@ string_from_portable(int pflags) #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) @@ -1225,7 +1227,7 @@ main(int argc, char **argv) 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; diff --git a/sftp.c b/sftp.c index 82ef58019..cf3dea048 100644 --- a/sftp.c +++ b/sftp.c @@ -1,4 +1,4 @@ -/* $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 * @@ -18,10 +18,10 @@ #include "includes.h" #include +#include #ifdef HAVE_SYS_STAT_H # include #endif -#include #include #include #include @@ -41,6 +41,7 @@ typedef void EditLine; #include #include #include +#include #include "xmalloc.h" #include "log.h" @@ -48,6 +49,7 @@ typedef void EditLine; #include "misc.h" #include "sftp.h" +#include "buffer.h" #include "sftp-common.h" #include "sftp-client.h" 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -50,11 +50,12 @@ #include #include +#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" 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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -64,11 +64,10 @@ #include #include +#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" 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 @@ -/* $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. * @@ -25,6 +25,8 @@ #include "includes.h" +#include + #include #include @@ -32,7 +34,6 @@ #include "xmalloc.h" #include "buffer.h" -#include "bufaux.h" #include "compat.h" #include "log.h" #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 @@ -/* $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. * @@ -28,8 +28,6 @@ #ifdef GSSAPI -#include "buffer.h" - #ifdef HAVE_GSSAPI_H #include #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 @@ -/* $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 * Copyright (c) 1994 Tatu Ylonen , Espoo, Finland @@ -40,7 +40,6 @@ #include "authfile.h" #include "uuencode.h" #include "buffer.h" -#include "bufaux.h" #include "pathnames.h" #include "log.h" #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 @@ -/* $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 . * @@ -23,20 +23,21 @@ #include #include #include +#include #include #include #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" 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 @@ -/* $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. * @@ -22,6 +22,7 @@ * (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 @@ -37,14 +38,13 @@ #include #include +#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" 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 @@ -/* $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 * @@ -14,8 +14,11 @@ * 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 + #include #include @@ -24,7 +27,6 @@ #include "xmalloc.h" #include "log.h" #include "buffer.h" -#include "bufaux.h" #include "key.h" #include "compat.h" #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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -69,15 +69,14 @@ #include #include +#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" @@ -1256,7 +1255,7 @@ load_public_identity_files(void) 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); diff --git a/ssh.h b/ssh.h index ed5fb9aaa..186cfff96 100644 --- a/ssh.h +++ b/ssh.h @@ -1,4 +1,4 @@ -/* $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 @@ -12,18 +12,6 @@ * called by a name other than "ssh" or "Secure Shell". */ -#ifndef SSH_H -#define SSH_H - -#include /* For struct sockaddr_in */ -#include /* For struct pw */ -#include /* For va_list */ -#include /* For LOG_AUTH and friends */ -#include /* For struct sockaddr_storage */ -#ifdef HAVE_SYS_SELECT_H -# include -#endif - /* Cipher used for encrypting authentication files. */ #define SSH_AUTHFILE_CIPHER SSH_CIPHER_3DES @@ -112,5 +100,3 @@ /* Listen backlog for sshd, ssh-agent and forwarding sockets */ #define SSH_LISTEN_BACKLOG 128 - -#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 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,8 +37,10 @@ #include #include -#include "ssh.h" #include "xmalloc.h" +#include "key.h" +#include "hostfile.h" +#include "ssh.h" #include "rsa.h" #include "buffer.h" #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 @@ -/* $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. @@ -23,13 +23,6 @@ * (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 -#include - -#include typedef struct Sensitive Sensitive; struct Sensitive { @@ -74,5 +67,3 @@ int ssh_local_cmd(const char *); strerror(errno)); \ errno = save_errno; \ } while (0) - -#endif diff --git a/sshconnect1.c b/sshconnect1.c index f0eee3bdf..51f1f8088 100644 --- a/sshconnect1.c +++ b/sshconnect1.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -15,30 +15,36 @@ #include "includes.h" +#include +#include + #include #include #include #include #include +#include +#include +#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. */ diff --git a/sshconnect2.c b/sshconnect2.c index 27e5442e9..e58d078c4 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -1,4 +1,4 @@ -/* $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. * @@ -26,24 +26,27 @@ #include "includes.h" #include +#include #include #include #include +#include +#include #include #include #include #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" diff --git a/sshd.c b/sshd.c index 5cefd1024..52c21e500 100644 --- a/sshd.c +++ b/sshd.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -45,14 +45,15 @@ #include "includes.h" #include +#include +#include #ifdef HAVE_SYS_STAT_H # include #endif -#include -#include #ifdef HAVE_SYS_TIME_H # include #endif +#include "openbsd-compat/sys-tree.h" #include #include @@ -77,28 +78,28 @@ #include #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" @@ -107,6 +108,9 @@ #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" diff --git a/sshlogin.c b/sshlogin.c index b01fde091..fba8a4d24 100644 --- a/sshlogin.c +++ b/sshlogin.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -43,9 +43,11 @@ #include #include +#include #include #include +#include #include #include #include diff --git a/sshlogin.h b/sshlogin.h index c0f9cd300..500d3fefd 100644 --- a/sshlogin.h +++ b/sshlogin.h @@ -1,4 +1,4 @@ -/* $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 @@ -11,11 +11,6 @@ * 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 -#include void record_login(pid_t, const char *, const char *, uid_t, const char *, struct sockaddr *, socklen_t); @@ -26,5 +21,3 @@ time_t get_last_login_time(uid_t, const char *, char *, u_int); void record_utmp_only(pid_t, const char *, const char *, const char *, struct sockaddr *, socklen_t); #endif - -#endif diff --git a/sshpty.c b/sshpty.c index 719a79303..79c62ee9c 100644 --- a/sshpty.c +++ b/sshpty.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -14,8 +14,8 @@ #include "includes.h" -#include #include +#include #include #include @@ -26,11 +26,12 @@ # include #endif #include +#include #include #include #ifdef HAVE_UTIL_H # include -#endif /* HAVE_UTIL_H */ +#endif #include #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 @@ -/* $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 @@ -14,12 +14,6 @@ * called by a name other than "ssh" or "Secure Shell". */ -#ifndef SSHPTY_H -#define SSHPTY_H - -#include - -#include #include struct termios get_saved_tio(void); @@ -31,5 +25,3 @@ void pty_release(const char *); 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 */ diff --git a/sshtty.c b/sshtty.c index 70668afde..04567669b 100644 --- a/sshtty.c +++ b/sshtty.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,8 +37,10 @@ #include "includes.h" +#include #include #include +#include #include "sshpty.h" diff --git a/ttymodes.c b/ttymodes.c index 680909b22..d8e2c553a 100644 --- a/ttymodes.c +++ b/ttymodes.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -45,16 +45,18 @@ #include "includes.h" +#include + #include #include #include +#include #include "packet.h" #include "log.h" #include "ssh1.h" #include "compat.h" #include "buffer.h" -#include "bufaux.h" #define TTY_OP_END 0 /* diff --git a/uidswap.c b/uidswap.c index 878258704..91d878c30 100644 --- a/uidswap.c +++ b/uidswap.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -14,13 +14,12 @@ #include "includes.h" -#include #include - #include #include #include #include +#include #include diff --git a/uidswap.h b/uidswap.h index 436c10f75..1c1163d75 100644 --- a/uidswap.h +++ b/uidswap.h @@ -1,4 +1,4 @@ -/* $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 @@ -12,16 +12,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -#ifndef UIDSWAP_H -#define UIDSWAP_H - -#include - -#include - 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 */ diff --git a/uuencode.c b/uuencode.c index 8a6742e95..a13949585 100644 --- a/uuencode.c +++ b/uuencode.c @@ -1,4 +1,4 @@ -/* $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. * @@ -26,9 +26,7 @@ #include "includes.h" #include - #include - #include #include diff --git a/uuencode.h b/uuencode.h index df09eb59b..fec55b491 100644 --- a/uuencode.h +++ b/uuencode.h @@ -1,4 +1,4 @@ -/* $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. @@ -24,12 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UUENCODE_H -#define UUENCODE_H - -#include - 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 diff --git a/xmalloc.c b/xmalloc.c index 6aea495ef..9985b4cc2 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -16,7 +16,6 @@ #include "includes.h" #include - #include #include #include diff --git a/xmalloc.h b/xmalloc.h index 27f25d584..fb217a45c 100644 --- a/xmalloc.h +++ b/xmalloc.h @@ -1,4 +1,4 @@ -/* $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 @@ -16,9 +16,6 @@ * 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); @@ -27,5 +24,3 @@ char *xstrdup(const char *); int xasprintf(char **, const char *, ...) __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2))); - -#endif /* XMALLOC_H */ -- cgit v1.2.3 From 4cbfe8ebebb1fb345bddab629768ad95885846d6 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 12:49:30 +1000 Subject: - (djm) [auth-pam.c auth.c bufaux.h entropy.c openbsd-compat/port-tun.c] remove last traces of bufaux.h - it was merged into buffer.h in the big includes.h commit --- ChangeLog | 5 ++++- auth-pam.c | 1 - auth.c | 1 - entropy.c | 1 - openbsd-compat/port-tun.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index f859f08ab..57c9d0225 100644 --- a/ChangeLog +++ b/ChangeLog @@ -86,6 +86,9 @@ [monitor.c session.c ssh-agent.c] spaces - (djm) [auth-pam.c defines.h] Move PAM related bits to auth-pam.c + - (djm) [auth-pam.c auth.c bufaux.h entropy.c openbsd-compat/port-tun.c] + remove last traces of bufaux.h - it was merged into buffer.h in the big + includes.h commit 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5156,4 +5159,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4454 2006/08/05 02:43:32 djm Exp $ +$Id: ChangeLog,v 1.4455 2006/08/05 02:49:30 djm Exp $ diff --git a/auth-pam.c b/auth-pam.c index a67eaa309..695198493 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -81,7 +81,6 @@ #include "auth.h" #include "auth-pam.h" #include "buffer.h" -#include "bufaux.h" #include "canohost.h" #include "log.h" #include "monitor_wrap.h" diff --git a/auth.c b/auth.c index fba32eb96..f2aee8fdb 100644 --- a/auth.c +++ b/auth.c @@ -60,7 +60,6 @@ #include "canohost.h" #include "uidswap.h" #include "misc.h" -#include "bufaux.h" #include "packet.h" #include "loginrec.h" #ifdef GSSAPI diff --git a/entropy.c b/entropy.c index b98e3c859..f0331a84e 100644 --- a/entropy.c +++ b/entropy.c @@ -46,7 +46,6 @@ #include "pathnames.h" #include "log.h" #include "buffer.h" -#include "bufaux.h" /* * Portable OpenSSH PRNG seeding: diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index f6a6aa9e1..d2ea03874 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -28,7 +28,7 @@ #include "log.h" #include "misc.h" -#include "bufaux.h" +#include "buffer.h" /* * This is the portable version of the SSH tunnel forwarding, it -- cgit v1.2.3 From 2a7bf6e7c790accc0eea7f52c82a138edae87a7f Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 13:23:49 +1000 Subject: ignore generated Makefile --- openbsd-compat/regress/.cvsignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 openbsd-compat/regress/.cvsignore (limited to 'openbsd-compat') diff --git a/openbsd-compat/regress/.cvsignore b/openbsd-compat/regress/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/openbsd-compat/regress/.cvsignore @@ -0,0 +1 @@ +Makefile -- cgit v1.2.3 From 475d61e1043604c0e65211361af08b99003af0d0 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 13:26:13 +1000 Subject: ignore built test binaries too --- openbsd-compat/regress/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'openbsd-compat') diff --git a/openbsd-compat/regress/.cvsignore b/openbsd-compat/regress/.cvsignore index f3c7a7c5d..afbf7cc3f 100644 --- a/openbsd-compat/regress/.cvsignore +++ b/openbsd-compat/regress/.cvsignore @@ -1 +1,5 @@ Makefile +snprintftest +strduptest +strtonumtest + -- cgit v1.2.3 From d04db59ad929d289c2dcaa466989659bbc449f6b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 13:27:29 +1000 Subject: - (djm) [openbsd-compat/regress/snprintftest.c] [openbsd-compat/regress/strduptest.c] Add missing includes so they pass compilation with "-Wall -Werror" --- ChangeLog | 5 ++++- openbsd-compat/regress/snprintftest.c | 1 + openbsd-compat/regress/strduptest.c | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 47069e286..180f4403b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -90,6 +90,9 @@ remove last traces of bufaux.h - it was merged into buffer.h in the big includes.h commit - (djm) [auth.c loginrec.c] Missing netinet/in.h for loginrec + - (djm) [openbsd-compat/regress/snprintftest.c] + [openbsd-compat/regress/strduptest.c] Add missing includes so they pass + compilation with "-Wall -Werror" 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5160,4 +5163,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4456 2006/08/05 02:54:24 djm Exp $ +$Id: ChangeLog,v 1.4457 2006/08/05 03:27:29 djm Exp $ diff --git a/openbsd-compat/regress/snprintftest.c b/openbsd-compat/regress/snprintftest.c index e25bf223f..8879244b5 100644 --- a/openbsd-compat/regress/snprintftest.c +++ b/openbsd-compat/regress/snprintftest.c @@ -21,6 +21,7 @@ #include #include #include +#include static int failed = 0; diff --git a/openbsd-compat/regress/strduptest.c b/openbsd-compat/regress/strduptest.c index 664a48ef4..7f6d779be 100644 --- a/openbsd-compat/regress/strduptest.c +++ b/openbsd-compat/regress/strduptest.c @@ -14,6 +14,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include +#include + static int fail = 0; void -- cgit v1.2.3 From 75bb664458d5a825824607841819b9a40d9bfdb5 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Aug 2006 14:07:20 +1000 Subject: - (djm) [auth-pam.c auth-shadow.c auth2-none.c cleanup.c sshd.c] [openbsd-compat/port-tun.c openbsd-compat/port-tun.h] Sprinkle more includes for Linux in --- ChangeLog | 5 ++++- auth-pam.c | 11 ++++++++--- auth-shadow.c | 2 ++ auth2-none.c | 1 + cleanup.c | 2 +- openbsd-compat/port-tun.c | 1 + openbsd-compat/port-tun.h | 2 ++ sshd.c | 1 + 8 files changed, 20 insertions(+), 5 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 180f4403b..f1b99d9e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -93,6 +93,9 @@ - (djm) [openbsd-compat/regress/snprintftest.c] [openbsd-compat/regress/strduptest.c] Add missing includes so they pass compilation with "-Wall -Werror" + - (djm) [auth-pam.c auth-shadow.c auth2-none.c cleanup.c sshd.c] + [openbsd-compat/port-tun.c openbsd-compat/port-tun.h] Sprinkle more + includes for Linux in 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5163,4 +5166,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4457 2006/08/05 03:27:29 djm Exp $ +$Id: ChangeLog,v 1.4458 2006/08/05 04:07:20 djm Exp $ diff --git a/auth-pam.c b/auth-pam.c index 695198493..8e9361caa 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -78,19 +78,24 @@ # define PAM_MSG_MEMBER(msg, n, member) ((msg)[(n)]->member) #endif +#include "xmalloc.h" +#include "buffer.h" +#include "key.h" +#include "hostfile.h" #include "auth.h" #include "auth-pam.h" -#include "buffer.h" #include "canohost.h" #include "log.h" -#include "monitor_wrap.h" #include "msg.h" #include "packet.h" #include "misc.h" #include "servconf.h" #include "ssh2.h" -#include "xmalloc.h" #include "auth-options.h" +#ifdef GSSAPI +#include "ssh-gss.h" +#endif +#include "monitor_wrap.h" extern ServerOptions options; extern Buffer loginmsg; diff --git a/auth-shadow.c b/auth-shadow.c index 7cd69c21f..52447fe4a 100644 --- a/auth-shadow.c +++ b/auth-shadow.c @@ -28,6 +28,8 @@ #include #include +#include "key.h" +#include "hostfile.h" #include "auth.h" #include "buffer.h" #include "log.h" diff --git a/auth2-none.c b/auth2-none.c index 1e4afa0e7..8cbef5278 100644 --- a/auth2-none.c +++ b/auth2-none.c @@ -29,6 +29,7 @@ #include #include +#include #include "xmalloc.h" #include "key.h" diff --git a/cleanup.c b/cleanup.c index c41ef1c6a..238f965e6 100644 --- a/cleanup.c +++ b/cleanup.c @@ -15,7 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "config.h" +#include "includes.h" #include diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index d2ea03874..3e73d8c0e 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -29,6 +29,7 @@ #include "log.h" #include "misc.h" #include "buffer.h" +#include "channels.h" /* * This is the portable version of the SSH tunnel forwarding, it diff --git a/openbsd-compat/port-tun.h b/openbsd-compat/port-tun.h index 9f7a98614..c53df01fc 100644 --- a/openbsd-compat/port-tun.h +++ b/openbsd-compat/port-tun.h @@ -17,6 +17,8 @@ #ifndef _PORT_TUN_H #define _PORT_TUN_H +struct Channel; + #if defined(SSH_TUN_LINUX) || defined(SSH_TUN_FREEBSD) # define CUSTOM_SYS_TUN_OPEN int sys_tun_open(int, int); diff --git a/sshd.c b/sshd.c index 52c21e500..9f14c3354 100644 --- a/sshd.c +++ b/sshd.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From e7eec90f387c1d8cde3f6f1e543866a62caaa8a4 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 5 Aug 2006 15:47:26 +1000 Subject: - (dtucker) [openbsd-compat/{bsd-arc4random.c,port-tun.c,xmmap.c}] Lots of #include stdarg.h, needed for log.h. --- ChangeLog | 4 +++- openbsd-compat/bsd-arc4random.c | 2 ++ openbsd-compat/port-tun.c | 1 + openbsd-compat/xmmap.c | 5 +++-- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index c3641cff8..8835fec20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -98,6 +98,8 @@ includes for Linux in - (dtucker) [cleanup.c] Need defines.h for __dead. - (dtucker) [auth2-gss.c] We still need the #ifdef GSSAPI in -portable. + - (dtucker) [openbsd-compat/{bsd-arc4random.c,port-tun.c,xmmap.c}] Lots of + #include stdarg.h, needed for log.h. 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5168,4 +5170,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4460 2006/08/05 05:24:59 dtucker Exp $ +$Id: ChangeLog,v 1.4461 2006/08/05 05:47:26 dtucker Exp $ diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c index c1aecfe99..d45fb182a 100644 --- a/openbsd-compat/bsd-arc4random.c +++ b/openbsd-compat/bsd-arc4random.c @@ -17,7 +17,9 @@ #include "includes.h" #include + #include +#include #include "log.h" diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index 3e73d8c0e..cadc331e1 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 6a1708e5d..95d5055b5 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.10 2006/07/25 09:52:08 dtucker Exp $ */ +/* $Id: xmmap.c,v 1.11 2006/08/05 05:47:27 dtucker Exp $ */ #include "includes.h" @@ -32,11 +32,12 @@ #include #endif #include + #ifdef HAVE_FCNTL_H # include #endif - #include +#include #include #include -- cgit v1.2.3 From d8aec107fec09a5e943d5ad96d364823b48249d8 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 5 Aug 2006 16:12:15 +1000 Subject: - (dtucker) [openbsd-compat/getrrsetbyname.c] Nees stdlib.h for malloc. --- ChangeLog | 3 ++- openbsd-compat/getrrsetbyname.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index c125d69b3..942884818 100644 --- a/ChangeLog +++ b/ChangeLog @@ -102,6 +102,7 @@ #include stdarg.h, needed for log.h. - (dtucker) [entropy.c] Needs unistd.h too. - (dtucker) [ssh-rand-helper.c] Needs stdarg.h for log.h. + - (dtucker) [openbsd-compat/getrrsetbyname.c] Nees stdlib.h for malloc. 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5172,4 +5173,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4463 2006/08/05 05:57:40 dtucker Exp $ +$Id: ChangeLog,v 1.4464 2006/08/05 06:12:15 dtucker Exp $ diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 70ef1850d..40155d5ab 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -49,6 +49,7 @@ #ifndef HAVE_GETRRSETBYNAME +#include #include #include "getrrsetbyname.h" -- cgit v1.2.3 From 8a15f01affbe332970fd8f8b07d3e6d8f7e6acb2 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 5 Aug 2006 16:27:20 +1000 Subject: - (dtucker) [openbsd-compat/strtonum.c] Include stdlib.h for strtoll, otherwise it is implicitly declared as returning an int. --- ChangeLog | 4 +++- openbsd-compat/strtonum.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 942884818..959211fb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -103,6 +103,8 @@ - (dtucker) [entropy.c] Needs unistd.h too. - (dtucker) [ssh-rand-helper.c] Needs stdarg.h for log.h. - (dtucker) [openbsd-compat/getrrsetbyname.c] Nees stdlib.h for malloc. + - (dtucker) [openbsd-compat/strtonum.c] Include stdlib.h for strtoll, + otherwise it is implicitly declared as returning an int. 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5173,4 +5175,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4464 2006/08/05 06:12:15 dtucker Exp $ +$Id: ChangeLog,v 1.4465 2006/08/05 06:27:20 dtucker Exp $ diff --git a/openbsd-compat/strtonum.c b/openbsd-compat/strtonum.c index 35c5c18b9..87f2f24b2 100644 --- a/openbsd-compat/strtonum.c +++ b/openbsd-compat/strtonum.c @@ -20,7 +20,9 @@ /* OPENBSD ORIGINAL: lib/libc/stdlib/strtonum.c */ #include "includes.h" + #ifndef HAVE_STRTONUM +#include #include #include -- cgit v1.2.3 From 92350103fcf406d054a698ab2ea34feb4bfff6fc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 5 Aug 2006 19:08:16 +1000 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Add headers required to compile on Cygwin. --- ChangeLog | 4 +++- openbsd-compat/bsd-cygwin_util.c | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 37e6532af..ce2ee60d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -118,6 +118,8 @@ - dtucker@cvs.openbsd.org 2006/08/05 08:34:04 [packet.c] Typo in comment + - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Add headers required to compile + on Cygwin. 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5188,4 +5190,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4469 2006/08/05 08:51:08 dtucker Exp $ +$Id: ChangeLog,v 1.4470 2006/08/05 09:08:16 dtucker Exp $ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index b408dde2d..4d31ef3b5 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -31,11 +31,16 @@ #ifdef HAVE_CYGWIN -#include -#include +#include +#include #include #include + +#include +#include +#include #include + #include "xmalloc.h" #define is_winnt (GetVersion() < 0x80000000) -- cgit v1.2.3 From 2b4e38b71276ac990a97bcfd0917d2514e85011b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 5 Aug 2006 19:18:08 +1000 Subject: - (dtucker) [openbsd-compat/fake-rfc2553.c] Add headers needed for inet_ntoa. --- ChangeLog | 3 ++- openbsd-compat/fake-rfc2553.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index ce2ee60d9..ec6294787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -120,6 +120,7 @@ Typo in comment - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Add headers required to compile on Cygwin. + - (dtucker) [openbsd-compat/fake-rfc2553.c] Add headers needed for inet_ntoa. 20060804 - (dtucker) [configure.ac] The "crippled AES" test does not work on recent @@ -5190,4 +5191,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4470 2006/08/05 09:08:16 dtucker Exp $ +$Id: ChangeLog,v 1.4471 2006/08/05 09:18:08 dtucker Exp $ diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index 08a7cb66c..b69f7f13f 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -38,6 +38,9 @@ #include "includes.h" #include +#include +#include + #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) -- cgit v1.2.3 From f78fb54412e34c2647c1bc9f895af00620f42730 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 6 Aug 2006 21:25:24 +1000 Subject: - (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c, glob.c}] Include stdlib.h for malloc and friends in compat code. --- ChangeLog | 4 +++- openbsd-compat/bsd-asprintf.c | 1 + openbsd-compat/bsd-openpty.c | 2 ++ openbsd-compat/bsd-snprintf.c | 2 ++ openbsd-compat/glob.c | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 60a1fd753..1efc7ba36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2006086 - (dtucker) [defines.h] With the includes.h changes we no longer get the name clash on "YES" so we can remove the workaround for it. + - (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c, + glob.c}] Include stdlib.h for malloc and friends in compat code. 20060805 - (djm) OpenBSD CVS Sync @@ -5198,4 +5200,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4475 2006/08/06 11:23:27 dtucker Exp $ +$Id: ChangeLog,v 1.4476 2006/08/06 11:25:24 dtucker Exp $ diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c index 1178296f8..67480139e 100644 --- a/openbsd-compat/bsd-asprintf.c +++ b/openbsd-compat/bsd-asprintf.c @@ -23,6 +23,7 @@ #include #include +#include #ifndef VA_COPY # ifdef HAVE_VA_COPY diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index a2f2fda60..c0cde6b1f 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -37,6 +37,8 @@ #include +#include + #ifdef HAVE_SYS_STAT_H # include #endif diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 9fdf4d3f0..47cbcff67 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -108,6 +108,8 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#include +#include #include #ifdef HAVE_LONG_DOUBLE diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 907235353..ec16b1108 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -37,10 +37,12 @@ #include #include + #include #include #include #include +#include #include #include -- cgit v1.2.3 From 0e5143e88e769b91cdd5b19e36a1d2403acc8e22 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 7 Aug 2006 11:26:36 +1000 Subject: - (djm) [openbsd-compat/bsd-getpeereid.c] Add some headers to quiet warnings on Solaris 10 --- ChangeLog | 8 ++++++-- openbsd-compat/bsd-getpeereid.c | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1efc7ba36..5d51f2e61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2006086 +20060806 + - (djm) [openbsd-compat/bsd-getpeereid.c] Add some headers to quiet warnings + on Solaris 10 + +20060806 - (dtucker) [defines.h] With the includes.h changes we no longer get the name clash on "YES" so we can remove the workaround for it. - (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c, @@ -5200,4 +5204,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4476 2006/08/06 11:25:24 dtucker Exp $ +$Id: ChangeLog,v 1.4477 2006/08/07 01:26:36 djm Exp $ diff --git a/openbsd-compat/bsd-getpeereid.c b/openbsd-compat/bsd-getpeereid.c index d94489d1d..bdae8b637 100644 --- a/openbsd-compat/bsd-getpeereid.c +++ b/openbsd-compat/bsd-getpeereid.c @@ -18,6 +18,11 @@ #if !defined(HAVE_GETPEEREID) +#include +#include + +#include + #if defined(SO_PEERCRED) int getpeereid(int s, uid_t *euid, gid_t *gid) -- cgit v1.2.3 From e6b641a9a13d664fb7b98227218a0b3f65dfd40c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Aug 2006 18:55:27 +1000 Subject: - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] Include stdlib.h for malloc and friends. --- ChangeLog | 6 +++++- openbsd-compat/fake-rfc2553.c | 2 ++ openbsd-compat/setproctitle.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 188512306..911fd3716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20060817 + - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] + Include stdlib.h for malloc and friends. + 20060816 - (djm) [audit-bsm.c] Sprinkle in some headers @@ -5210,4 +5214,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4479 2006/08/16 01:40:45 djm Exp $ +$Id: ChangeLog,v 1.4480 2006/08/17 08:55:27 dtucker Exp $ diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c index b69f7f13f..b6ea3d21e 100644 --- a/openbsd-compat/fake-rfc2553.c +++ b/openbsd-compat/fake-rfc2553.c @@ -36,6 +36,8 @@ */ #include "includes.h" + +#include #include #include diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index 7fec73f89..b511f6649 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c @@ -36,6 +36,7 @@ #ifndef HAVE_SETPROCTITLE #include +#include #include #ifdef HAVE_SYS_PSTAT_H #include -- cgit v1.2.3 From 3083bc2b52fe00b5c5fe87dd3638969835dab0e8 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Aug 2006 19:35:49 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Use F_CLOSEM fcntl for closefrom() on AIX. Pointed out by William Ahern. --- ChangeLog | 4 +++- configure.ac | 10 ++++++++-- openbsd-compat/bsd-closefrom.c | 7 +++++++ 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 911fd3716..3f253c021 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20060817 - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] Include stdlib.h for malloc and friends. + - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Use F_CLOSEM fcntl + for closefrom() on AIX. Pointed out by William Ahern. 20060816 - (djm) [audit-bsm.c] Sprinkle in some headers @@ -5214,4 +5216,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4480 2006/08/17 08:55:27 dtucker Exp $ +$Id: ChangeLog,v 1.4481 2006/08/17 09:35:49 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 31dac052e..7a296ae8b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.348 2006/08/04 09:44:23 dtucker Exp $ +# $Id: configure.ac,v 1.349 2006/08/17 09:35:49 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.348 $) +AC_REVISION($Revision: 1.349 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -180,6 +180,12 @@ case "$host" in [#include ] ) AC_CHECK_FUNCS(setauthdb) + AC_CHECK_DECL(F_CLOSEM, + AC_DEFINE(USE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), + [], + [ #include + #include ] + ) check_for_aix_broken_getaddrinfo=1 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.]) AC_DEFINE(SETEUID_BREAKS_SETUID, 1, diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 3f17302d1..e7a521e43 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -22,6 +22,9 @@ #include #include #include +#ifdef HAVE_FCNTL_H +# include +#endif #include #include #include @@ -76,6 +79,10 @@ closefrom(int lowfd) } (void) closedir(dirp); } else +#elif defined(USE_FCNTL_CLOSEM) + if (fcntl(lowfd, F_CLOSEM, 0) != -1) { + return; + } else #endif { /* -- cgit v1.2.3 From c889ffdbc6329f21d2437b3c3d17eba0960969fc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Aug 2006 19:40:35 +1000 Subject: - (dtucker) [openbsd-compat/regress/{Makefile.in,closefromtest.c}] Regress test for closefrom() in compat code. --- ChangeLog | 4 ++- openbsd-compat/regress/Makefile.in | 7 ++-- openbsd-compat/regress/closefromtest.c | 60 ++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 openbsd-compat/regress/closefromtest.c (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 3f253c021..1f37e7477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Include stdlib.h for malloc and friends. - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Use F_CLOSEM fcntl for closefrom() on AIX. Pointed out by William Ahern. + - (dtucker) [openbsd-compat/regress/{Makefile.in,closefromtest.c}] Regress + test for closefrom() in compat code. 20060816 - (djm) [audit-bsm.c] Sprinkle in some headers @@ -5216,4 +5218,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4481 2006/08/17 09:35:49 dtucker Exp $ +$Id: ChangeLog,v 1.4482 2006/08/17 09:40:35 dtucker Exp $ diff --git a/openbsd-compat/regress/Makefile.in b/openbsd-compat/regress/Makefile.in index 51383a777..3a0a4c4da 100644 --- a/openbsd-compat/regress/Makefile.in +++ b/openbsd-compat/regress/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.1 2006/02/19 11:50:20 dtucker Exp $ +# $Id: Makefile.in,v 1.2 2006/08/17 09:40:35 dtucker Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -14,7 +14,7 @@ LIBS=@LIBS@ LDFLAGS=-L.. -lopenbsd-compat @LDFLAGS@ LIBCOMPAT=../libopenbsd-compat.a -TESTPROGS=strtonumtest strduptest snprintftest +TESTPROGS=closefromtest strtonumtest strduptest snprintftest all: t-exec ${OTHERTESTS} @@ -32,6 +32,9 @@ strtonumtest: strtonumtest.c $(LIBCOMPAT) strduptest: strduptest.c $(LIBCOMPAT) $(CC) $(CFLAGS) $(CPPFLAGS) -o strduptest $< $(LDFLAGS) +closefromtest: closefromtest.c $(LIBCOMPAT) + $(CC) $(CFLAGS) $(CPPFLAGS) -o closefromtest $< $(LDFLAGS) + clean: rm -f *.o *.a core $(TESTPROGS) valid.out diff --git a/openbsd-compat/regress/closefromtest.c b/openbsd-compat/regress/closefromtest.c new file mode 100644 index 000000000..feb1b567d --- /dev/null +++ b/openbsd-compat/regress/closefromtest.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2006 Darren Tucker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include +#include +#include +#include + +#define NUM_OPENS 10 + +void +fail(char *msg) +{ + fprintf(stderr, "closefrom: %s\n", msg); + exit(1); +} + +int +main(void) +{ + int i, max, fds[NUM_OPENS]; + char buf[512]; + + for (i = 0; i < NUM_OPENS; i++) + if ((fds[i] = open("/dev/null", "r")) == -1) + exit(0); /* can't test */ + max = i - 1; + + /* should close last fd only */ + closefrom(fds[max]); + if (close(fds[max]) != -1) + fail("failed to close highest fd"); + + /* make sure we can still use remaining descriptors */ + for (i = 0; i < max; i++) + if (read(fds[i], buf, sizeof(buf)) == -1) + fail("closed descriptors it should not have"); + + /* should close all fds */ + closefrom(fds[0]); + for (i = 0; i < NUM_OPENS; i++) + if (close(fds[i]) != -1) + fail("failed to close from lowest fd"); +} -- cgit v1.2.3 From d018b2e9c88f6669c68f3343dbbf53e6084e8ff7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 18 Aug 2006 18:51:20 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Resync with closefrom.c from sudo. --- ChangeLog | 6 +++++- configure.ac | 6 +++--- openbsd-compat/bsd-closefrom.c | 20 +++++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 1f37e7477..599e7eca1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20060818 + - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Resync with + closefrom.c from sudo. + 20060817 - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] Include stdlib.h for malloc and friends. @@ -5218,4 +5222,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4482 2006/08/17 09:40:35 dtucker Exp $ +$Id: ChangeLog,v 1.4483 2006/08/18 08:51:20 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 7a296ae8b..f8e6cd4ce 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.349 2006/08/17 09:35:49 dtucker Exp $ +# $Id: configure.ac,v 1.350 2006/08/18 08:51:20 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.349 $) +AC_REVISION($Revision: 1.350 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -181,7 +181,7 @@ case "$host" in ) AC_CHECK_FUNCS(setauthdb) AC_CHECK_DECL(F_CLOSEM, - AC_DEFINE(USE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), + AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), [], [ #include #include ] diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index e7a521e43..4b72920d6 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Todd C. Miller + * Copyright (c) 2004-2005 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -52,12 +52,19 @@ #endif #ifndef lint -static const char sudorcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: closefrom.c,v 1.11 2006/08/17 15:26:54 millert Exp $"; #endif /* lint */ /* * Close all file descriptors greater than or equal to lowfd. */ +#ifdef HAVE_FCNTL_CLOSEM +void +closefrom(int lowfd) +{ + (void) fcntl(lowfd, F_CLOSEM, 0); +} +#else void closefrom(int lowfd) { @@ -70,7 +77,7 @@ closefrom(int lowfd) /* Check for a /proc/$$/fd directory. */ len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid()); - if (len >= 0 && (u_int)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { + if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { while ((dent = readdir(dirp)) != NULL) { fd = strtol(dent->d_name, &endp, 10); if (dent->d_name != endp && *endp == '\0' && @@ -79,10 +86,6 @@ closefrom(int lowfd) } (void) closedir(dirp); } else -#elif defined(USE_FCNTL_CLOSEM) - if (fcntl(lowfd, F_CLOSEM, 0) != -1) { - return; - } else #endif { /* @@ -102,6 +105,5 @@ closefrom(int lowfd) (void) close((int) fd); } } - +#endif /* !HAVE_FCNTL_CLOSEM */ #endif /* HAVE_CLOSEFROM */ - -- cgit v1.2.3 From 43d3ccdbddde9f73e35622248067a050a289480d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 18 Aug 2006 19:49:58 +1000 Subject: - (dtucker) [openbsd-compat/bsd-closefrom.c] Comment out rcsid. --- ChangeLog | 3 ++- openbsd-compat/bsd-closefrom.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 599e7eca1..42da7a05c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 20060818 - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Resync with closefrom.c from sudo. + - (dtucker) [openbsd-compat/bsd-closefrom.c] Comment out rcsid. 20060817 - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] @@ -5222,4 +5223,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4483 2006/08/18 08:51:20 dtucker Exp $ +$Id: ChangeLog,v 1.4484 2006/08/18 09:49:58 dtucker Exp $ diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 4b72920d6..9380b33a7 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -51,7 +51,7 @@ # define OPEN_MAX 256 #endif -#ifndef lint +#if 0 __unused static const char rcsid[] = "$Sudo: closefrom.c,v 1.11 2006/08/17 15:26:54 millert Exp $"; #endif /* lint */ -- cgit v1.2.3 From ec4e4daa6c9010aee4d0a6c6d49f740e1b0f4013 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 18 Aug 2006 20:09:32 +1000 Subject: - (dtucker) [openbsd-compat/regress/snprintftest.c] Newline on error. --- ChangeLog | 3 ++- openbsd-compat/regress/snprintftest.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 42da7a05c..c03112b81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Resync with closefrom.c from sudo. - (dtucker) [openbsd-compat/bsd-closefrom.c] Comment out rcsid. + - (dtucker) [openbsd-compat/regress/snprintftest.c] Newline on error. 20060817 - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] @@ -5223,4 +5224,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4484 2006/08/18 09:49:58 dtucker Exp $ +$Id: ChangeLog,v 1.4485 2006/08/18 10:09:32 dtucker Exp $ diff --git a/openbsd-compat/regress/snprintftest.c b/openbsd-compat/regress/snprintftest.c index 8879244b5..4ca63e180 100644 --- a/openbsd-compat/regress/snprintftest.c +++ b/openbsd-compat/regress/snprintftest.c @@ -28,7 +28,7 @@ static int failed = 0; static void fail(const char *m) { - fprintf(stderr, "%s", m); + fprintf(stderr, "snprintftest: %s\n", m); failed = 1; } -- cgit v1.2.3 From 637c80aa6f1bbbb93935fe102790820e8bec3a27 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 18 Aug 2006 20:56:18 +1000 Subject: - (dtucker) [openbsd-compat/regress/Makefile.in] Use implicit rules for the test progs instead; they work better than what we have. --- ChangeLog | 4 +++- openbsd-compat/regress/Makefile.in | 11 +---------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index c03112b81..4c5e3b9ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ closefrom.c from sudo. - (dtucker) [openbsd-compat/bsd-closefrom.c] Comment out rcsid. - (dtucker) [openbsd-compat/regress/snprintftest.c] Newline on error. + - (dtucker) [openbsd-compat/regress/Makefile.in] Use implicit rules for the + test progs instead; they work better than what we have. 20060817 - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] @@ -5224,4 +5226,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4485 2006/08/18 10:09:32 dtucker Exp $ +$Id: ChangeLog,v 1.4486 2006/08/18 10:56:18 dtucker Exp $ diff --git a/openbsd-compat/regress/Makefile.in b/openbsd-compat/regress/Makefile.in index 3a0a4c4da..22dab2837 100644 --- a/openbsd-compat/regress/Makefile.in +++ b/openbsd-compat/regress/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.2 2006/08/17 09:40:35 dtucker Exp $ +# $Id: Makefile.in,v 1.3 2006/08/18 10:56:19 dtucker Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -26,15 +26,6 @@ t-exec: $(TESTPROGS) done @echo finished compat regress tests -strtonumtest: strtonumtest.c $(LIBCOMPAT) - $(CC) $(CFLAGS) $(CPPFLAGS) -o strtonumtest $< $(LDFLAGS) - -strduptest: strduptest.c $(LIBCOMPAT) - $(CC) $(CFLAGS) $(CPPFLAGS) -o strduptest $< $(LDFLAGS) - -closefromtest: closefromtest.c $(LIBCOMPAT) - $(CC) $(CFLAGS) $(CPPFLAGS) -o closefromtest $< $(LDFLAGS) - clean: rm -f *.o *.a core $(TESTPROGS) valid.out -- cgit v1.2.3 From f0625699dff5e62e69b454acd9ea4c5bef7787b5 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 19 Aug 2006 19:12:14 +1000 Subject: - (dtucker) [openbsd-compat/regress/Makefile.in] Add $(EXEEXT) and add a single rule for the test progs. --- ChangeLog | 4 +++- openbsd-compat/regress/Makefile.in | 15 ++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 9f956a579..e24ad3444 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ - djm@cvs.openbsd.org 2006/08/18 22:41:29 [gss-genr.c] GSSAPI error code should be 0 and not -1; from simon@sxw.org.uk + - (dtucker) [openbsd-compat/regress/Makefile.in] Add $(EXEEXT) and add a + single rule for the test progs. 20060818 - (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Resync with @@ -5272,4 +5274,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4497 2006/08/18 22:50:57 djm Exp $ +$Id: ChangeLog,v 1.4498 2006/08/19 09:12:14 dtucker Exp $ diff --git a/openbsd-compat/regress/Makefile.in b/openbsd-compat/regress/Makefile.in index 22dab2837..bcf214bd0 100644 --- a/openbsd-compat/regress/Makefile.in +++ b/openbsd-compat/regress/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.3 2006/08/18 10:56:19 dtucker Exp $ +# $Id: Makefile.in,v 1.4 2006/08/19 09:12:14 dtucker Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -10,19 +10,24 @@ CC=@CC@ LD=@LD@ CFLAGS=@CFLAGS@ CPPFLAGS=-I. -I.. -I$(srcdir) -I$(srcdir)/.. @CPPFLAGS@ @DEFS@ +EXEEXT=@EXEEXT@ +LIBCOMPAT=../libopenbsd-compat.a LIBS=@LIBS@ -LDFLAGS=-L.. -lopenbsd-compat @LDFLAGS@ +LDFLAGS=@LDFLAGS@ $(LIBCOMPAT) -LIBCOMPAT=../libopenbsd-compat.a -TESTPROGS=closefromtest strtonumtest strduptest snprintftest +TESTPROGS=closefromtest$(EXEEXT) snprintftest$(EXEEXT) strduptest$(EXEEXT) \ + strtonumtest$(EXEEXT) all: t-exec ${OTHERTESTS} +%$(EXEEXT): %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBCOMPAT) $(LIBS) + t-exec: $(TESTPROGS) @echo running compat regress tests @for TEST in ""$?; do \ echo "run test $${TEST}" ... 1>&2; \ - ./$${TEST} || exit $$? ; \ + ./$${TEST}$(EXEEXT) || exit $$? ; \ done @echo finished compat regress tests -- cgit v1.2.3 From fe408b4826f92b96976b46dec02218bd66dfc6e1 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:41:03 +1000 Subject: - (dtucker) [openbsd-compat/basename.c] Include errno.h. --- ChangeLog | 5 ++++- openbsd-compat/basename.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 6fd1ec198..9b20380de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060824 + - (dtucker) [openbsd-compat/basename.c] Include errno.h. + 20060822 - (dtucker) [Makefile.in] Bug #1177: fix incorrect path for sshrc in Makefile. Patch from santhi.amirta at gmail, ok djm. @@ -5288,4 +5291,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4504 2006/08/22 12:24:10 dtucker Exp $ +$Id: ChangeLog,v 1.4505 2006/08/24 09:41:03 dtucker Exp $ diff --git a/openbsd-compat/basename.c b/openbsd-compat/basename.c index 4b10cb84b..ffa5c8984 100644 --- a/openbsd-compat/basename.c +++ b/openbsd-compat/basename.c @@ -20,6 +20,7 @@ #include "includes.h" #ifndef HAVE_BASENAME +#include #include char * -- cgit v1.2.3 From e086955531ffef96bc15d51a07f25ae65804dc1c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:43:16 +1000 Subject: - (dtucker) [openbsd-compat/bsd-misc.c] Add includes needed for select(2) on older systems. --- ChangeLog | 4 +++- openbsd-compat/bsd-misc.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 9b20380de..af8381fe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20060824 - (dtucker) [openbsd-compat/basename.c] Include errno.h. + - (dtucker) [openbsd-compat/bsd-misc.c] Add includes needed for select(2) on + older systems. 20060822 - (dtucker) [Makefile.in] Bug #1177: fix incorrect path for sshrc in @@ -5291,4 +5293,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4505 2006/08/24 09:41:03 dtucker Exp $ +$Id: ChangeLog,v 1.4506 2006/08/24 09:43:16 dtucker Exp $ diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index e6128f9a7..c6b80365c 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -17,8 +17,13 @@ #include "includes.h" +#ifdef HAVE_SYS_TIME_H +# include +#endif + #include #include +#include #include "xmalloc.h" -- cgit v1.2.3 From 450d2af2a3f07e46cc1490a0029a9f669dd60108 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:45:33 +1000 Subject: - (dtucker) [openbsd-compat/bsd-misc.c] Include for select(2) on POSIX systems. --- ChangeLog | 4 +++- openbsd-compat/bsd-misc.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index af8381fe0..338360e8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - (dtucker) [openbsd-compat/basename.c] Include errno.h. - (dtucker) [openbsd-compat/bsd-misc.c] Add includes needed for select(2) on older systems. + - (dtucker) [openbsd-compat/bsd-misc.c] Include for select(2) + on POSIX systems. 20060822 - (dtucker) [Makefile.in] Bug #1177: fix incorrect path for sshrc in @@ -5293,4 +5295,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4506 2006/08/24 09:43:16 dtucker Exp $ +$Id: ChangeLog,v 1.4507 2006/08/24 09:45:33 dtucker Exp $ diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index c6b80365c..17d731bd2 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -17,6 +17,9 @@ #include "includes.h" +#ifdef HAVE_SYS_SELECT_H +# include +#endif #ifdef HAVE_SYS_TIME_H # include #endif -- cgit v1.2.3 From f80f5ec81bf445d09034a2caff93bc3582cd87c3 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:52:30 +1000 Subject: - (dtucker) [openbsd-compat/bsd-openpty.c] Include for ioctl(2). --- ChangeLog | 3 ++- openbsd-compat/bsd-openpty.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 338360e8f..e1b7a8b4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ older systems. - (dtucker) [openbsd-compat/bsd-misc.c] Include for select(2) on POSIX systems. + - (dtucker) [openbsd-compat/bsd-openpty.c] Include for ioctl(2). 20060822 - (dtucker) [Makefile.in] Bug #1177: fix incorrect path for sshrc in @@ -5295,4 +5296,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4507 2006/08/24 09:45:33 dtucker Exp $ +$Id: ChangeLog,v 1.4508 2006/08/24 09:52:30 dtucker Exp $ diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c index c0cde6b1f..9777eb556 100644 --- a/openbsd-compat/bsd-openpty.c +++ b/openbsd-compat/bsd-openpty.c @@ -42,6 +42,9 @@ #ifdef HAVE_SYS_STAT_H # include #endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif #ifdef HAVE_FCNTL_H # include -- cgit v1.2.3 From c1abe8e3e89de85d5f0b093e0cc2b56a6cdc6887 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:53:40 +1000 Subject: - (dtucker) [openbsd-compat/rresvport.c] Include for malloc. --- ChangeLog | 3 ++- openbsd-compat/rresvport.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index e1b7a8b4a..80e521d99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ - (dtucker) [openbsd-compat/bsd-misc.c] Include for select(2) on POSIX systems. - (dtucker) [openbsd-compat/bsd-openpty.c] Include for ioctl(2). + - (dtucker) [openbsd-compat/rresvport.c] Include for malloc. 20060822 - (dtucker) [Makefile.in] Bug #1177: fix incorrect path for sshrc in @@ -5296,4 +5297,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4508 2006/08/24 09:52:30 dtucker Exp $ +$Id: ChangeLog,v 1.4509 2006/08/24 09:53:40 dtucker Exp $ diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index c10391872..15790e852 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -36,6 +36,7 @@ #ifndef HAVE_RRESVPORT_AF #include +#include #include #if 0 -- cgit v1.2.3 From 9162028887ac2cd40e66b08868748e53f8d9d1ac Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 24 Aug 2006 19:58:36 +1000 Subject: - (dtucker) [openbsd-compat/xmmap.c] Move #define HAVE_MMAP to prevent unused variable warning when we have a broken or missing mmap(2). Now with 100% more diff! --- openbsd-compat/xmmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 95d5055b5..0fb23269b 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.11 2006/08/05 05:47:27 dtucker Exp $ */ +/* $Id: xmmap.c,v 1.12 2006/08/24 09:58:36 dtucker Exp $ */ #include "includes.h" @@ -45,9 +45,9 @@ void *xmmap(size_t size) { +#ifdef HAVE_MMAP void *address; -#ifdef HAVE_MMAP # ifdef MAP_ANON address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, (off_t)0); -- cgit v1.2.3 From 8ff1da81ec5e3032befb98349ec6ceba84dab706 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 30 Aug 2006 17:52:03 +1000 Subject: - (djm) [openbsd-compat/xcrypt.c] needs unistd.h --- ChangeLog | 3 ++- openbsd-compat/xcrypt.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index ae8db7fd9..feabcb4e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ - djm@cvs.openbsd.org 2006/08/30 00:14:37 [version.h] crank to 4.4 + - (djm) [openbsd-compat/xcrypt.c] needs unistd.h 20060824 - (dtucker) [openbsd-compat/basename.c] Include errno.h. @@ -5328,4 +5329,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4516 2006/08/30 01:09:01 djm Exp $ +$Id: ChangeLog,v 1.4517 2006/08/30 07:52:03 djm Exp $ diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index 5d260f2c2..14899321f 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c @@ -25,6 +25,7 @@ #include "includes.h" #include +#include #include # ifdef HAVE_CRYPT_H -- cgit v1.2.3 From 26d4e19caa3013f57dc3c1462847eceaac6a1d7d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 30 Aug 2006 22:33:09 +1000 Subject: - (dtucker) [auth.c openbsd-compat/port-aix.c] Bug #1207: always call loginsuccess on AIX immediately after authentication to clear the failed login count. Previously this would only happen when an interactive session starts (ie when a pty is allocated) but this means that accounts that have primarily non-interactive sessions (eg scp's) may gradually accumulate enough failures to lock out an account. This change may have a side effect of creating two audit records, one with a tty of "ssh" corresponding to the authentication and one with the allocated pty per interactive session. --- ChangeLog | 11 ++++++++++- auth.c | 5 +++++ openbsd-compat/port-aix.c | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index feabcb4e6..d9aa6f6d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,15 @@ [version.h] crank to 4.4 - (djm) [openbsd-compat/xcrypt.c] needs unistd.h + - (dtucker) [auth.c openbsd-compat/port-aix.c] Bug #1207: always call + loginsuccess on AIX immediately after authentication to clear the failed + login count. Previously this would only happen when an interactive + session starts (ie when a pty is allocated) but this means that accounts + that have primarily non-interactive sessions (eg scp's) may gradually + accumulate enough failures to lock out an account. This change may have + a side effect of creating two audit records, one with a tty of "ssh" + corresponding to the authentication and one with the allocated pty per + interactive session. 20060824 - (dtucker) [openbsd-compat/basename.c] Include errno.h. @@ -5329,4 +5338,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4517 2006/08/30 07:52:03 djm Exp $ +$Id: ChangeLog,v 1.4518 2006/08/30 12:33:09 dtucker Exp $ diff --git a/auth.c b/auth.c index 5a02a4364..5da140b07 100644 --- a/auth.c +++ b/auth.c @@ -279,6 +279,11 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info) strcmp(method, "challenge-response") == 0)) record_failed_login(authctxt->user, get_canonical_hostname(options.use_dns), "ssh"); +# ifdef WITH_AIXAUTHENTICATE + if (authenticated) + sys_auth_record_login(authctxt->user, + get_canonical_hostname(options.use_dns), "ssh", &loginmsg); +# endif #endif #ifdef SSH_AUDIT_EVENTS if (authenticated == 0 && !authctxt->postponed) diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index a7ced57e9..13a73e873 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -265,15 +265,17 @@ sys_auth_record_login(const char *user, const char *host, const char *ttynm, Buffer *loginmsg) { char *msg = NULL; + static int msg_done = 0; int success = 0; aix_setauthdb(user); if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) { success = 1; - if (msg != NULL) { + if (msg != NULL && loginmsg != NULL && !msg_done) { debug("AIX/loginsuccess: msg %s", msg); buffer_append(loginmsg, msg, strlen(msg)); xfree(msg); + msg_done = 1; } } aix_restoreauthdb(); -- cgit v1.2.3 From 1b06dc30ad4692ec76c476d130ba7366f7ebfef2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 31 Aug 2006 03:24:41 +1000 Subject: - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] [platform.c platform.h sshd.c openbsd-compat/Makefile.in] [openbsd-compat/openbsd-compat.h openbsd-compat/port-solaris.c] [openbsd-compat/port-solaris.h] Add support for Solaris process contracts, enabled with --use-solaris-contracts. Patch from Chad Mynhier, tweaked by dtucker@ and myself; ok dtucker@ --- CREDITS | 3 +- ChangeLog | 10 ++- LICENCE | 1 + Makefile.in | 7 +- configure.ac | 22 ++++- includes.h | 1 + openbsd-compat/Makefile.in | 4 +- openbsd-compat/openbsd-compat.h | 8 +- openbsd-compat/port-solaris.c | 189 ++++++++++++++++++++++++++++++++++++++++ openbsd-compat/port-solaris.h | 27 ++++++ platform.c | 46 ++++++++++ platform.h | 23 +++++ sshd.c | 3 + 13 files changed, 332 insertions(+), 12 deletions(-) create mode 100644 openbsd-compat/port-solaris.c create mode 100644 openbsd-compat/port-solaris.h create mode 100644 platform.c create mode 100644 platform.h (limited to 'openbsd-compat') diff --git a/CREDITS b/CREDITS index 82b9f2210..eaf105a91 100644 --- a/CREDITS +++ b/CREDITS @@ -25,6 +25,7 @@ Chris, the Young One - Password auth fixes Christos Zoulas - Autoconf fixes Chun-Chung Chen - RPM fixes Corinna Vinschen - Cygwin support +Chad Mynhier - Solaris Process Contract support Dan Brosemer - Autoconf support, build fixes Darren Hall - AIX patches Darren Tucker - AIX BFF package scripts @@ -100,5 +101,5 @@ Apologies to anyone I have missed. Damien Miller -$Id: CREDITS,v 1.80 2005/08/26 20:15:20 tim Exp $ +$Id: CREDITS,v 1.81 2006/08/30 17:24:41 djm Exp $ diff --git a/ChangeLog b/ChangeLog index d9aa6f6d5..0a702d3fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +20060831 + - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] + [platform.c platform.h sshd.c openbsd-compat/Makefile.in] + [openbsd-compat/openbsd-compat.h openbsd-compat/port-solaris.c] + [openbsd-compat/port-solaris.h] Add support for Solaris process + contracts, enabled with --use-solaris-contracts. Patch from Chad + Mynhier, tweaked by dtucker@ and myself; ok dtucker@ + 20060830 - (djm) OpenBSD CVS Sync - dtucker@cvs.openbsd.org 2006/08/21 08:14:01 @@ -5338,4 +5346,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4518 2006/08/30 12:33:09 dtucker Exp $ +$Id: ChangeLog,v 1.4519 2006/08/30 17:24:41 djm Exp $ diff --git a/LICENCE b/LICENCE index 17d94aef5..0c2ff067a 100644 --- a/LICENCE +++ b/LICENCE @@ -288,6 +288,7 @@ OpenSSH contains no GPL code. Internet Software Consortium. Todd C. Miller Reyk Floeter + Chad Mynhier * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/Makefile.in b/Makefile.in index e1f86dbef..525b08eba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.280 2006/08/22 12:24:11 dtucker Exp $ +# $Id: Makefile.in,v 1.281 2006/08/30 17:24:41 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -44,6 +44,7 @@ CFLAGS=@CFLAGS@ CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LIBS=@LIBS@ LIBSELINUX=@LIBSELINUX@ +SSHDLIBS=@SSHDLIBS@ LIBEDIT=@LIBEDIT@ LIBPAM=@LIBPAM@ LIBWRAP=@LIBWRAP@ @@ -87,7 +88,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ auth-krb5.o \ auth2-gss.o gss-serv.o gss-serv-krb5.o \ loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ - audit.o audit-bsm.o + audit.o audit-bsm.o platform.o MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out ssh-keysign.8.out sshd_config.5.out ssh_config.5.out MANPAGES_IN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 ssh-keysign.8 sshd_config.5 ssh_config.5 @@ -137,7 +138,7 @@ ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS) $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) - $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBSELINUX) $(LIBS) + $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBSELINUX) $(SSHDLIBS) $(LIBS) scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) diff --git a/configure.ac b/configure.ac index 90cfbea9a..3aba414a2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.355 2006/08/20 11:43:19 dtucker Exp $ +# $Id: configure.ac,v 1.356 2006/08/30 17:24:41 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.355 $) +AC_REVISION($Revision: 1.356 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -127,6 +127,10 @@ AC_ARG_WITH(rpath, ] ) +# Messages for features tested for in target-specific section +SIA_MSG="no" +SPC_MSG="no" + # Check for some target-specific stuff case "$host" in *-*-aix*) @@ -438,6 +442,17 @@ mips-sony-bsd|mips-sony-newsos4) else AC_MSG_RESULT(no) fi + AC_ARG_WITH(solaris-contracts, + [ --with-solaris-contracts Enable Solaris process contracts (experimental)], + [ + AC_CHECK_LIB(contract, ct_tmpl_activate, + [ AC_DEFINE(USE_SOLARIS_PROCESS_CONTRACTS, 1, + [Define if you have Solaris process contracts]) + SSHDLIBS="$SSHDLIBS -lcontract" + AC_SUBST(SSHDLIBS) + SPC_MSG="yes" ], ) + ], + ) ;; *-*-sunos4*) CPPFLAGS="$CPPFLAGS -DSUNOS4" @@ -586,6 +601,7 @@ mips-sony-bsd|mips-sony-newsos4) system's login() call]) AC_DEFINE(DISABLE_FD_PASSING) LIBS="$LIBS -lsecurity -ldb -lm -laud" + SIA_MSG="yes" else AC_MSG_RESULT(no) AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin", @@ -3905,6 +3921,7 @@ echo " sshd superuser user PATH: $J" fi echo " Manpage format: $MANTYPE" echo " PAM support: $PAM_MSG" +echo " OSF SIA support: $SIA_MSG" echo " KerberosV support: $KRB5_MSG" echo " SELinux support: $SELINUX_MSG" echo " Smartcard support: $SCARD_MSG" @@ -3912,6 +3929,7 @@ echo " S/KEY support: $SKEY_MSG" echo " TCP Wrappers support: $TCPW_MSG" echo " MD5 password support: $MD5_MSG" echo " libedit support: $LIBEDIT_MSG" +echo " Solaris process contract support: $SPC_MSG" echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" echo " BSD Auth support: $BSD_AUTH_MSG" diff --git a/includes.h b/includes.h index 8e600567d..03665a3d3 100644 --- a/includes.h +++ b/includes.h @@ -160,6 +160,7 @@ #include "defines.h" +#include "platform.h" #include "openbsd-compat/openbsd-compat.h" #include "openbsd-compat/bsd-nextstep.h" diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 67e521bfe..9f06605d7 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.39 2006/04/22 11:26:08 djm Exp $ +# $Id: Makefile.in,v 1.40 2006/08/30 17:24:41 djm Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -20,7 +20,7 @@ OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgroupl COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o -PORTS=port-irix.o port-linux.o port-aix.o port-uw.o port-tun.o +PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 18249d81e..278ac71d9 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.40 2006/07/12 13:10:34 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.41 2006/08/30 17:24:42 djm Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -190,10 +190,12 @@ char *shadow_pw(struct passwd *pw); /* Routines for a single OS platform */ #include "bsd-cray.h" #include "bsd-cygwin_util.h" + +#include "port-aix.h" #include "port-irix.h" #include "port-linux.h" -#include "port-aix.h" -#include "port-uw.h" +#include "port-solaris.h" #include "port-tun.h" +#include "port-uw.h" #endif /* _OPENBSD_COMPAT_H */ diff --git a/openbsd-compat/port-solaris.c b/openbsd-compat/port-solaris.c new file mode 100644 index 000000000..f31f0c6ea --- /dev/null +++ b/openbsd-compat/port-solaris.c @@ -0,0 +1,189 @@ +/* $Id: port-solaris.c,v 1.1 2006/08/30 17:24:42 djm Exp $ */ + +/* + * Copyright (c) 2006 Chad Mynhier. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "config.h" +#include "includes.h" + +#ifdef USE_SOLARIS_PROCESS_CONTRACTS + +#include +#include +#include + +#include +#ifdef HAVE_FCNTL_H +# include +#endif +#include +#include + +#include +#include +#include + +#include "log.h" + +#define CT_TEMPLATE CTFS_ROOT "/process/template" +#define CT_LATEST CTFS_ROOT "/process/latest" + +static int tmpl_fd = -1; + +/* Lookup the latest process contract */ +static ctid_t +get_active_process_contract_id(void) +{ + int stat_fd; + ctid_t ctid = -1; + ct_stathdl_t stathdl; + + if ((stat_fd = open64(CT_LATEST, O_RDONLY)) == -1) { + error("%s: Error opening 'latest' process " + "contract: %s", __func__, strerror(errno)); + return -1; + } + if (ct_status_read(stat_fd, CTD_COMMON, &stathdl) != 0) { + error("%s: Error reading process contract " + "status: %s", __func__, strerror(errno)); + goto out; + } + if ((ctid = ct_status_get_id(stathdl)) < 0) { + error("%s: Error getting process contract id: %s", + __func__, strerror(errno)); + goto out; + } + + ct_status_free(stathdl); + out: + close(stat_fd); + return ctid; +} + +void +solaris_contract_pre_fork(void) +{ + if ((tmpl_fd = open64(CT_TEMPLATE, O_RDWR)) == -1) { + error("%s: open %s: %s", __func__, + CT_TEMPLATE, strerror(errno)); + return; + } + + debug2("%s: setting up process contract template on fd %d", + __func__, tmpl_fd); + + /* We have to set certain attributes before activating the template */ + if (ct_pr_tmpl_set_fatal(tmpl_fd, + CT_PR_EV_HWERR|CT_PR_EV_SIGNAL|CT_PR_EV_CORE) != 0) { + error("%s: Error setting process contract template " + "fatal events: %s", __func__, strerror(errno)); + goto fail; + } + if (ct_tmpl_set_critical(tmpl_fd, CT_PR_EV_HWERR) != 0) { + error("%s: Error setting process contract template " + "critical events: %s", __func__, strerror(errno)); + goto fail; + } + + /* Now make this the active template for this process. */ + if (ct_tmpl_activate(tmpl_fd) != 0) { + error("%s: Error activating process contract " + "template: %s", __func__, strerror(errno)); + goto fail; + } + return; + + fail: + if (tmpl_fd != -1) { + close(tmpl_fd); + tmpl_fd = -1; + } +} + +void +solaris_contract_post_fork_child() +{ + debug2("%s: clearing process contract template on fd %d", + __func__, tmpl_fd); + + /* Clear the active template. */ + if (ct_tmpl_clear(tmpl_fd) != 0) + error("%s: Error clearing active process contract " + "template: %s", __func__, strerror(errno)); + + close(tmpl_fd); + tmpl_fd = -1; +} + +void +solaris_contract_post_fork_parent(pid_t pid) +{ + ctid_t ctid; + char ctl_path[256]; + int r, ctl_fd = -1, stat_fd = -1; + + debug2("%s: clearing template (fd %d)", __func__, tmpl_fd); + + if (tmpl_fd == -1) + return; + + /* First clear the active template. */ + if ((r = ct_tmpl_clear(tmpl_fd)) != 0) + error("%s: Error clearing active process contract " + "template: %s", __func__, strerror(errno)); + + close(tmpl_fd); + tmpl_fd = -1; + + /* + * If either the fork didn't succeed (pid < 0), or clearing + * th active contract failed (r != 0), then we have nothing + * more do. + */ + if (r != 0 || pid <= 0) + return; + + /* Now lookup and abandon the contract we've created. */ + ctid = get_active_process_contract_id(); + + debug2("%s: abandoning contract id %ld", __func__, ctid); + + snprintf(ctl_path, sizeof(ctl_path), + CTFS_ROOT "/process/%ld/ctl", ctid); + if ((ctl_fd = open64(ctl_path, O_WRONLY)) < 0) { + error("%s: Error opening process contract " + "ctl file: %s", __func__, strerror(errno)); + goto fail; + } + if (ct_ctl_abandon(ctl_fd) < 0) { + error("%s: Error abandoning process contract: %s", + __func__, strerror(errno)); + goto fail; + } + close(ctl_fd); + return; + + fail: + if (tmpl_fd != -1) { + close(tmpl_fd); + tmpl_fd = -1; + } + if (stat_fd != -1) + close(stat_fd); + if (ctl_fd != -1) + close(ctl_fd); +} +#endif diff --git a/openbsd-compat/port-solaris.h b/openbsd-compat/port-solaris.h new file mode 100644 index 000000000..4c324871e --- /dev/null +++ b/openbsd-compat/port-solaris.h @@ -0,0 +1,27 @@ +/* $Id: port-solaris.h,v 1.1 2006/08/30 17:24:42 djm Exp $ */ + +/* + * Copyright (c) 2006 Chad Mynhier. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _PORT_SOLARIS_H + +#include + +void solaris_contract_pre_fork(void); +void solaris_contract_post_fork_child(void); +void solaris_contract_post_fork_parent(pid_t pid); + +#endif diff --git a/platform.c b/platform.c new file mode 100644 index 000000000..aee4b01e7 --- /dev/null +++ b/platform.c @@ -0,0 +1,46 @@ +/* $Id: platform.c,v 1.1 2006/08/30 17:24:41 djm Exp $ */ + +/* + * Copyright (c) 2006 Darren Tucker. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "config.h" +#include "platform.h" + +#include "openbsd-compat/openbsd-compat.h" + +void +platform_pre_fork(void) +{ +#ifdef USE_SOLARIS_PROCESS_CONTRACTS + solaris_contract_pre_fork(); +#endif +} + +void +platform_post_fork_parent(pid_t child_pid) +{ +#ifdef USE_SOLARIS_PROCESS_CONTRACTS + solaris_contract_post_fork_parent(child_pid); +#endif +} + +void +platform_post_fork_child(void) +{ +#ifdef USE_SOLARIS_PROCESS_CONTRACTS + solaris_contract_post_fork_child(); +#endif +} diff --git a/platform.h b/platform.h new file mode 100644 index 000000000..cf93bc57c --- /dev/null +++ b/platform.h @@ -0,0 +1,23 @@ +/* $Id: platform.h,v 1.1 2006/08/30 17:24:41 djm Exp $ */ + +/* + * Copyright (c) 2006 Darren Tucker. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +void platform_pre_fork(void); +void platform_post_fork_parent(pid_t child_pid); +void platform_post_fork_child(void); diff --git a/sshd.c b/sshd.c index dcc626589..ee588ff8a 100644 --- a/sshd.c +++ b/sshd.c @@ -1154,6 +1154,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * the child process the connection. The * parent continues listening. */ + platform_pre_fork(); if ((pid = fork()) == 0) { /* * Child. Close the listening and @@ -1163,6 +1164,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * We break out of the loop to handle * the connection. */ + platform_post_fork_child(); startup_pipe = startup_p[1]; close_startup_pipes(); close_listen_socks(); @@ -1178,6 +1180,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) } /* Parent. Stay in the loop. */ + platform_post_fork_parent(pid); if (pid < 0) error("fork: %.100s", strerror(errno)); else -- cgit v1.2.3 From ded319cca23923651ddc5e6a4bd4bda66d0737f4 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 1 Sep 2006 15:38:36 +1000 Subject: - (djm) [audit-bsm.c audit.c auth-bsdauth.c auth-chall.c auth-pam.c] [auth-rsa.c auth-shadow.c auth-sia.c auth1.c auth2-chall.c] [auth2-gss.c auth2-kbdint.c auth2-none.c authfd.c authfile.c] [cipher-3des1.c cipher-aes.c cipher-bf1.c cipher-ctr.c clientloop.c] [dh.c dns.c entropy.c gss-serv-krb5.c gss-serv.c hostfile.c kex.c] [kexdhc.c kexdhs.c kexgexc.c kexgexs.c key.c loginrec.c mac.c] [md5crypt.c monitor.c monitor_wrap.c readconf.c rsa.c] [scard-opensc.c scard.c session.c ssh-add.c ssh-agent.c ssh-dss.c] [ssh-keygen.c ssh-keysign.c ssh-rsa.c ssh.c sshconnect.c] [sshconnect1.c sshconnect2.c sshd.c rc4.diff] [openbsd-compat/bsd-cray.c openbsd-compat/port-aix.c] [openbsd-compat/port-linux.c openbsd-compat/port-solaris.c] [openbsd-compat/port-uw.c] Lots of headers for SCO OSR6, mainly adding stdarg.h for log.h; compile problems reported by rac AT tenzing.org --- ChangeLog | 19 ++++++++++++++++++- audit-bsm.c | 3 ++- audit.c | 5 ++++- auth-bsdauth.c | 2 ++ auth-chall.c | 2 ++ auth-pam.c | 1 + auth-rsa.c | 1 + auth-shadow.c | 1 + auth-sia.c | 17 +++++++++-------- auth1.c | 1 + auth2-chall.c | 1 + auth2-gss.c | 2 ++ auth2-kbdint.c | 2 ++ auth2-none.c | 1 + authfd.c | 1 + authfile.c | 1 + cipher-3des1.c | 1 + cipher-aes.c | 4 ++++ cipher-bf1.c | 1 + cipher-ctr.c | 1 + clientloop.c | 1 + dh.c | 1 + dns.c | 1 + entropy.c | 1 + gss-serv-krb5.c | 1 + gss-serv.c | 1 + hostfile.c | 1 + kex.c | 1 + kexdhc.c | 1 + kexdhs.c | 2 ++ kexgexc.c | 1 + kexgexs.c | 1 + key.c | 1 + loginrec.c | 1 + mac.c | 1 + md5crypt.c | 4 ++++ monitor.c | 1 + monitor_wrap.c | 1 + openbsd-compat/bsd-cray.c | 3 ++- openbsd-compat/port-aix.c | 1 + openbsd-compat/port-linux.c | 3 ++- openbsd-compat/port-solaris.c | 3 ++- openbsd-compat/port-uw.c | 15 +++++++++++++-- readconf.c | 1 + rsa.c | 1 + scard-opensc.c | 4 ++++ scard.c | 1 + session.c | 1 + ssh-add.c | 1 + ssh-agent.c | 1 + ssh-dss.c | 1 + ssh-keygen.c | 1 + ssh-keysign.c | 1 + ssh-rsa.c | 1 + ssh.c | 1 + sshconnect.c | 1 + sshconnect1.c | 1 + sshconnect2.c | 1 + sshd.c | 1 + 59 files changed, 117 insertions(+), 16 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index bef6b0538..ebf308975 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +20060901 + - (djm) [audit-bsm.c audit.c auth-bsdauth.c auth-chall.c auth-pam.c] + [auth-rsa.c auth-shadow.c auth-sia.c auth1.c auth2-chall.c] + [auth2-gss.c auth2-kbdint.c auth2-none.c authfd.c authfile.c] + [cipher-3des1.c cipher-aes.c cipher-bf1.c cipher-ctr.c clientloop.c] + [dh.c dns.c entropy.c gss-serv-krb5.c gss-serv.c hostfile.c kex.c] + [kexdhc.c kexdhs.c kexgexc.c kexgexs.c key.c loginrec.c mac.c] + [md5crypt.c monitor.c monitor_wrap.c readconf.c rsa.c] + [scard-opensc.c scard.c session.c ssh-add.c ssh-agent.c ssh-dss.c] + [ssh-keygen.c ssh-keysign.c ssh-rsa.c ssh.c sshconnect.c] + [sshconnect1.c sshconnect2.c sshd.c rc4.diff] + [openbsd-compat/bsd-cray.c openbsd-compat/port-aix.c] + [openbsd-compat/port-linux.c openbsd-compat/port-solaris.c] + [openbsd-compat/port-uw.c] + Lots of headers for SCO OSR6, mainly adding stdarg.h for log.h; + compile problems reported by rac AT tenzing.org + 20060831 - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] [platform.c platform.h sshd.c openbsd-compat/Makefile.in] @@ -5348,4 +5365,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4520 2006/08/31 01:28:49 dtucker Exp $ +$Id: ChangeLog,v 1.4521 2006/09/01 05:38:36 djm Exp $ diff --git a/audit-bsm.c b/audit-bsm.c index 50241b32f..d5cf302ce 100644 --- a/audit-bsm.c +++ b/audit-bsm.c @@ -1,4 +1,4 @@ -/* $Id: audit-bsm.c,v 1.3 2006/08/16 01:40:45 djm Exp $ */ +/* $Id: audit-bsm.c,v 1.4 2006/09/01 05:38:36 djm Exp $ */ /* * TODO @@ -39,6 +39,7 @@ #include +#include #include #include "ssh.h" diff --git a/audit.c b/audit.c index 8c3ec5a6a..dbea34cb2 100644 --- a/audit.c +++ b/audit.c @@ -1,4 +1,4 @@ -/* $Id: audit.c,v 1.4 2006/08/05 14:05:10 dtucker Exp $ */ +/* $Id: audit.c,v 1.5 2006/09/01 05:38:36 djm Exp $ */ /* * Copyright (c) 2004, 2005 Darren Tucker. All rights reserved. @@ -26,6 +26,9 @@ #include "includes.h" +#include +#include + #ifdef SSH_AUDIT_EVENTS #include "audit.h" diff --git a/auth-bsdauth.c b/auth-bsdauth.c index f718e5d38..37d527d11 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c @@ -27,6 +27,8 @@ #include +#include + #ifdef BSD_AUTH #include "xmalloc.h" #include "key.h" diff --git a/auth-chall.c b/auth-chall.c index 9c1079a17..919b1eaa4 100644 --- a/auth-chall.c +++ b/auth-chall.c @@ -27,6 +27,8 @@ #include +#include + #include "xmalloc.h" #include "key.h" #include "hostfile.h" diff --git a/auth-pam.c b/auth-pam.c index 8e9361caa..493993a10 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -54,6 +54,7 @@ #include #include +#include #include #include diff --git a/auth-rsa.c b/auth-rsa.c index 1c66b86a4..8c43458b0 100644 --- a/auth-rsa.c +++ b/auth-rsa.c @@ -24,6 +24,7 @@ #include #include +#include #include #include "xmalloc.h" diff --git a/auth-shadow.c b/auth-shadow.c index 52447fe4a..8b3160aee 100644 --- a/auth-shadow.c +++ b/auth-shadow.c @@ -26,6 +26,7 @@ #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) #include +#include #include #include "key.h" diff --git a/auth-sia.c b/auth-sia.c index af7182b48..63304d36e 100644 --- a/auth-sia.c +++ b/auth-sia.c @@ -25,14 +25,6 @@ #include "includes.h" #ifdef HAVE_OSF_SIA -#include "ssh.h" -#include "auth.h" -#include "auth-sia.h" -#include "log.h" -#include "servconf.h" -#include "canohost.h" -#include "uidswap.h" - #include #include #include @@ -40,8 +32,17 @@ #include #include #include +#include #include +#include "ssh.h" +#include "auth.h" +#include "auth-sia.h" +#include "log.h" +#include "servconf.h" +#include "canohost.h" +#include "uidswap.h" + extern ServerOptions options; extern int saved_argc; extern char **saved_argv; diff --git a/auth1.c b/auth1.c index 34dcf6266..b9d6b1115 100644 --- a/auth1.c +++ b/auth1.c @@ -14,6 +14,7 @@ #include +#include #include #include #include diff --git a/auth2-chall.c b/auth2-chall.c index b091957b1..b78b739cd 100644 --- a/auth2-chall.c +++ b/auth2-chall.c @@ -28,6 +28,7 @@ #include +#include #include #include diff --git a/auth2-gss.c b/auth2-gss.c index d88bc4273..c77c841a3 100644 --- a/auth2-gss.c +++ b/auth2-gss.c @@ -30,6 +30,8 @@ #include +#include + #include "xmalloc.h" #include "key.h" #include "hostfile.h" diff --git a/auth2-kbdint.c b/auth2-kbdint.c index 901596484..a4fc9e6f7 100644 --- a/auth2-kbdint.c +++ b/auth2-kbdint.c @@ -27,6 +27,8 @@ #include +#include + #include "xmalloc.h" #include "packet.h" #include "key.h" diff --git a/auth2-none.c b/auth2-none.c index f455bdde3..952b44824 100644 --- a/auth2-none.c +++ b/auth2-none.c @@ -30,6 +30,7 @@ #include #include +#include #include #include "xmalloc.h" diff --git a/authfd.c b/authfd.c index 5c910df13..61faad123 100644 --- a/authfd.c +++ b/authfd.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/authfile.c b/authfile.c index 675085646..735c64780 100644 --- a/authfile.c +++ b/authfile.c @@ -49,6 +49,7 @@ #include #include +#include #include #include #include diff --git a/cipher-3des1.c b/cipher-3des1.c index 61798bfde..fc16e20d7 100644 --- a/cipher-3des1.c +++ b/cipher-3des1.c @@ -29,6 +29,7 @@ #include +#include #include #include "xmalloc.h" diff --git a/cipher-aes.c b/cipher-aes.c index 99e9eea92..14ef10f03 100644 --- a/cipher-aes.c +++ b/cipher-aes.c @@ -28,8 +28,12 @@ #include "openbsd-compat/openssl-compat.h" #ifdef USE_BUILTIN_RIJNDAEL +#include #include + +#include + #include "rijndael.h" #include "xmalloc.h" #include "log.h" diff --git a/cipher-bf1.c b/cipher-bf1.c index eb4c04777..292488c5c 100644 --- a/cipher-bf1.c +++ b/cipher-bf1.c @@ -29,6 +29,7 @@ #include +#include #include #include "xmalloc.h" diff --git a/cipher-ctr.c b/cipher-ctr.c index 9733b7d56..b24f3a428 100644 --- a/cipher-ctr.c +++ b/cipher-ctr.c @@ -18,6 +18,7 @@ #include +#include #include #include diff --git a/clientloop.c b/clientloop.c index 132d75a44..88dfb1f32 100644 --- a/clientloop.c +++ b/clientloop.c @@ -78,6 +78,7 @@ #include #endif #include +#include #include #include #include diff --git a/dh.c b/dh.c index 925eedddf..f6ef05cf6 100644 --- a/dh.c +++ b/dh.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include diff --git a/dns.c b/dns.c index 229210835..92623de72 100644 --- a/dns.c +++ b/dns.c @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/entropy.c b/entropy.c index c89e0b528..4f19c8767 100644 --- a/entropy.c +++ b/entropy.c @@ -34,6 +34,7 @@ #ifdef HAVE_FCNTL_H # include #endif +#include #include #include diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c index 006bedad9..5a625acb8 100644 --- a/gss-serv-krb5.c +++ b/gss-serv-krb5.c @@ -31,6 +31,7 @@ #include +#include #include #include "xmalloc.h" diff --git a/gss-serv.c b/gss-serv.c index 296f63a89..e8191a859 100644 --- a/gss-serv.c +++ b/gss-serv.c @@ -30,6 +30,7 @@ #include +#include #include #include diff --git a/hostfile.c b/hostfile.c index 08ba44264..2cceb352a 100644 --- a/hostfile.c +++ b/hostfile.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include diff --git a/kex.c b/kex.c index 0c36519a1..bfc1c11f9 100644 --- a/kex.c +++ b/kex.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/kexdhc.c b/kexdhc.c index bf875ae07..64de7af30 100644 --- a/kexdhc.c +++ b/kexdhc.c @@ -27,6 +27,7 @@ #include +#include #include #include #include diff --git a/kexdhs.c b/kexdhs.c index 7d2c21eed..93ec97f93 100644 --- a/kexdhs.c +++ b/kexdhs.c @@ -26,6 +26,8 @@ #include "includes.h" #include + +#include #include #include diff --git a/kexgexc.c b/kexgexc.c index fc48880d4..2c19713e1 100644 --- a/kexgexc.c +++ b/kexgexc.c @@ -28,6 +28,7 @@ #include +#include #include #include #include diff --git a/kexgexs.c b/kexgexs.c index 7599f2af4..5373a633a 100644 --- a/kexgexs.c +++ b/kexgexs.c @@ -28,6 +28,7 @@ #include +#include #include #include #include diff --git a/key.c b/key.c index 40aab20ea..f3b3d6b94 100644 --- a/key.c +++ b/key.c @@ -39,6 +39,7 @@ #include +#include #include #include diff --git a/loginrec.c b/loginrec.c index 7850312b6..67447edc0 100644 --- a/loginrec.c +++ b/loginrec.c @@ -156,6 +156,7 @@ #include #include #include +#include #include #include diff --git a/mac.c b/mac.c index edf9b69bd..e5d5bfa88 100644 --- a/mac.c +++ b/mac.c @@ -29,6 +29,7 @@ #include +#include #include #include diff --git a/md5crypt.c b/md5crypt.c index 253fdfdf2..22ef98933 100644 --- a/md5crypt.c +++ b/md5crypt.c @@ -11,6 +11,10 @@ #include "includes.h" #if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) +#include + +#include + #include /* 0 ... 63 => ascii - 64 */ diff --git a/monitor.c b/monitor.c index 83b3765a0..b3ccde017 100644 --- a/monitor.c +++ b/monitor.c @@ -40,6 +40,7 @@ #endif #include #include +#include #include #include diff --git a/monitor_wrap.c b/monitor_wrap.c index 431b3e495..3865539df 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index 8093f6d54..1532c991c 100644 --- a/openbsd-compat/bsd-cray.c +++ b/openbsd-compat/bsd-cray.c @@ -1,5 +1,5 @@ /* - * $Id: bsd-cray.c,v 1.15 2006/07/24 05:08:36 djm Exp $ + * $Id: bsd-cray.c,v 1.16 2006/09/01 05:38:41 djm Exp $ * * bsd-cray.c * @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 13a73e873..d0a423005 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -41,6 +41,7 @@ # include #endif #include +#include #include #include #include diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index 5e2e878dc..77f3a1c17 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c @@ -1,4 +1,4 @@ -/* $Id: port-linux.c,v 1.2 2006/07/24 04:51:01 djm Exp $ */ +/* $Id: port-linux.c,v 1.3 2006/09/01 05:38:41 djm Exp $ */ /* * Copyright (c) 2005 Daniel Walsh @@ -24,6 +24,7 @@ #include "includes.h" #include +#include #include #ifdef WITH_SELINUX diff --git a/openbsd-compat/port-solaris.c b/openbsd-compat/port-solaris.c index f31f0c6ea..f57433e78 100644 --- a/openbsd-compat/port-solaris.c +++ b/openbsd-compat/port-solaris.c @@ -1,4 +1,4 @@ -/* $Id: port-solaris.c,v 1.1 2006/08/30 17:24:42 djm Exp $ */ +/* $Id: port-solaris.c,v 1.2 2006/09/01 05:38:41 djm Exp $ */ /* * Copyright (c) 2006 Chad Mynhier. @@ -29,6 +29,7 @@ #ifdef HAVE_FCNTL_H # include #endif +#include #include #include diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c index c64427121..6f3523902 100644 --- a/openbsd-compat/port-uw.c +++ b/openbsd-compat/port-uw.c @@ -26,15 +26,26 @@ #include "includes.h" #ifdef HAVE_LIBIAF +#include #ifdef HAVE_CRYPT_H -#include +# include #endif +#include +#include +#include +#include +#include + +#include "xmalloc.h" #include "packet.h" #include "buffer.h" +#include "auth-options.h" #include "log.h" #include "servconf.h" +#include "key.h" +#include "hostfile.h" #include "auth.h" -#include "auth-options.h" +#include "ssh.h" int nischeck(char *); diff --git a/readconf.c b/readconf.c index c57ea0c82..4cacf6026 100644 --- a/readconf.c +++ b/readconf.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/rsa.c b/rsa.c index 875b486c4..08cc82007 100644 --- a/rsa.c +++ b/rsa.c @@ -64,6 +64,7 @@ #include +#include #include #include "xmalloc.h" diff --git a/scard-opensc.c b/scard-opensc.c index 7a496dff8..4751ea295 100644 --- a/scard-opensc.c +++ b/scard-opensc.c @@ -26,9 +26,13 @@ #include "includes.h" #if defined(SMARTCARD) && defined(USE_OPENSC) +#include + #include #include +#include + #include #include diff --git a/scard.c b/scard.c index a2d28cba1..328655edd 100644 --- a/scard.c +++ b/scard.c @@ -29,6 +29,7 @@ #include #include +#include #include #include diff --git a/session.c b/session.c index 006e4304d..15c5ca9a0 100644 --- a/session.c +++ b/session.c @@ -53,6 +53,7 @@ #endif #include #include +#include #include #include #include diff --git a/ssh-add.c b/ssh-add.c index 518f47066..4dc46f6db 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include diff --git a/ssh-agent.c b/ssh-agent.c index 6bc1e541a..08b07212e 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -58,6 +58,7 @@ # include #endif #include +#include #include #include #include diff --git a/ssh-dss.c b/ssh-dss.c index 448f704f6..fbc078e84 100644 --- a/ssh-dss.c +++ b/ssh-dss.c @@ -30,6 +30,7 @@ #include #include +#include #include #include "xmalloc.h" diff --git a/ssh-keygen.c b/ssh-keygen.c index c607e257e..969bd2359 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -29,6 +29,7 @@ # include #endif #include +#include #include #include #include diff --git a/ssh-keysign.c b/ssh-keysign.c index 1ddb2a058..c4bc7e56e 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -30,6 +30,7 @@ #include #endif #include +#include #include #include #include diff --git a/ssh-rsa.c b/ssh-rsa.c index 28444c1f9..0e16ff85f 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "xmalloc.h" diff --git a/ssh.c b/ssh.c index 07a4ca3c8..a34990b54 100644 --- a/ssh.c +++ b/ssh.c @@ -60,6 +60,7 @@ #endif #include #include +#include #include #include #include diff --git a/sshconnect.c b/sshconnect.c index 71ca4ec52..823def6a9 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -32,6 +32,7 @@ #include #endif #include +#include #include #include #include diff --git a/sshconnect1.c b/sshconnect1.c index 51f1f8088..90fcb344f 100644 --- a/sshconnect1.c +++ b/sshconnect1.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/sshconnect2.c b/sshconnect2.c index 5846c8e9c..dd971a9f9 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/sshd.c b/sshd.c index ee588ff8a..3fb146424 100644 --- a/sshd.c +++ b/sshd.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 607aede26c4193bf1bc5063698ea9a36cbd990e3 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 1 Sep 2006 15:48:19 +1000 Subject: - (djm) [includes.h monitor.c openbsd-compat/bindresvport.c] [openbsd-compat/rresvport.c] Some more headers: netinet/in.h sys/socket.h and unistd.h in various places --- ChangeLog | 7 +++++-- includes.h | 2 ++ monitor.c | 1 + openbsd-compat/bindresvport.c | 4 +++- openbsd-compat/rresvport.c | 5 +++++ 5 files changed, 16 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index ebf308975..c00df6884 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,12 +8,15 @@ [md5crypt.c monitor.c monitor_wrap.c readconf.c rsa.c] [scard-opensc.c scard.c session.c ssh-add.c ssh-agent.c ssh-dss.c] [ssh-keygen.c ssh-keysign.c ssh-rsa.c ssh.c sshconnect.c] - [sshconnect1.c sshconnect2.c sshd.c rc4.diff] + [sshconnect1.c sshconnect2.c sshd.c] [openbsd-compat/bsd-cray.c openbsd-compat/port-aix.c] [openbsd-compat/port-linux.c openbsd-compat/port-solaris.c] [openbsd-compat/port-uw.c] Lots of headers for SCO OSR6, mainly adding stdarg.h for log.h; compile problems reported by rac AT tenzing.org + - (djm) [includes.h monitor.c openbsd-compat/bindresvport.c] + [openbsd-compat/rresvport.c] Some more headers: netinet/in.h + sys/socket.h and unistd.h in various places 20060831 - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] @@ -5365,4 +5368,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4521 2006/09/01 05:38:36 djm Exp $ +$Id: ChangeLog,v 1.4522 2006/09/01 05:48:19 djm Exp $ diff --git a/includes.h b/includes.h index 03665a3d3..2101f13c9 100644 --- a/includes.h +++ b/includes.h @@ -21,6 +21,7 @@ #define _GNU_SOURCE /* activate extra prototypes for glibc */ #include +#include /* For CMSG_* */ #ifdef HAVE_LIMITS_H # include /* For PATH_MAX */ @@ -106,6 +107,7 @@ #include /* for grantpt() and friends */ #endif +#include #include /* For typedefs */ #ifdef HAVE_RPC_TYPES_H # include /* For INADDR_LOOPBACK */ diff --git a/monitor.c b/monitor.c index b3ccde017..364bd2316 100644 --- a/monitor.c +++ b/monitor.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef SKEY #include diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index ef0eff3b6..e8fb83f23 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -33,8 +33,10 @@ #include "includes.h" #ifndef HAVE_BINDRESVPORT_SA +#include +#include -#include "includes.h" +#include #include #include diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index 15790e852..17e66ca59 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -35,6 +35,11 @@ #ifndef HAVE_RRESVPORT_AF +#include +#include + +#include + #include #include #include -- cgit v1.2.3 From 0646ca6be81c4f0f619d92a4e5a041b58c79a221 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 1 Sep 2006 19:29:01 +1000 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Fix implict declaration warnings for binary_open and binary_close. Patch from Corinna Vinschen. --- ChangeLog | 4 +++- openbsd-compat/bsd-cygwin_util.c | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index c00df6884..f10393f3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,8 @@ - (djm) [includes.h monitor.c openbsd-compat/bindresvport.c] [openbsd-compat/rresvport.c] Some more headers: netinet/in.h sys/socket.h and unistd.h in various places + - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Fix implict declaration + warnings for binary_open and binary_close. Patch from Corinna Vinschen. 20060831 - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] @@ -5368,4 +5370,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4522 2006/09/01 05:48:19 djm Exp $ +$Id: ChangeLog,v 1.4523 2006/09/01 09:29:01 dtucker Exp $ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 4d31ef3b5..dbf8176b6 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -31,6 +31,13 @@ #ifdef HAVE_CYGWIN +#if defined(open) && open == binary_open +# undef open +#endif +#if defined(pipe) && open == binary_pipe +# undef pipe +#endif + #include #include #include @@ -48,13 +55,6 @@ #define ntsec_off(c) ((c) && strstr((c),"nontsec")) #define ntea_on(c) ((c) && strstr((c),"ntea") && !strstr((c),"nontea")) -#if defined(open) && open == binary_open -# undef open -#endif -#if defined(pipe) && open == binary_pipe -# undef pipe -#endif - int binary_open(const char *filename, int flags, ...) { -- cgit v1.2.3 From 096faecdea1e39ecace0b20f4e208bd7ec33f6d2 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 1 Sep 2006 20:29:10 +1000 Subject: - (dtucker) [configure.ac includes.h openbsd-compat/glob.{c,h}] Explicitly test for GLOB_NOMATCH and use our glob functions if it's not found. Stops sftp from segfaulting when attempting to get a nonexistent file on Cygwin (previous versions of OpenSSH didn't use the native glob). Partly from and tested by Corinna Vinschen. --- ChangeLog | 7 ++++++- configure.ac | 6 ++++-- includes.h | 3 ++- openbsd-compat/glob.c | 3 ++- openbsd-compat/glob.h | 3 ++- 5 files changed, 16 insertions(+), 6 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index f10393f3c..0cbd4b627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,11 @@ sys/socket.h and unistd.h in various places - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Fix implict declaration warnings for binary_open and binary_close. Patch from Corinna Vinschen. + - (dtucker) [configure.ac includes.h openbsd-compat/glob.{c,h}] Explicitly + test for GLOB_NOMATCH and use our glob functions if it's not found. + Stops sftp from segfaulting when attempting to get a nonexistent file on + Cygwin (previous versions of OpenSSH didn't use the native glob). Partly + from and tested by Corinna Vinschen. 20060831 - (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ] @@ -5370,4 +5375,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4523 2006/09/01 09:29:01 dtucker Exp $ +$Id: ChangeLog,v 1.4524 2006/09/01 10:29:10 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 3aba414a2..c37d7f499 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.356 2006/08/30 17:24:41 djm Exp $ +# $Id: configure.ac,v 1.357 2006/09/01 10:29:11 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.356 $) +AC_REVISION($Revision: 1.357 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -982,6 +982,8 @@ AC_TRY_COMPILE( ] ) +AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include ]) + AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ diff --git a/includes.h b/includes.h index 2101f13c9..967fcc26c 100644 --- a/includes.h +++ b/includes.h @@ -30,7 +30,8 @@ # include #endif #if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \ - defined(GLOB_HAS_GL_MATCHC) + defined(GLOB_HAS_GL_MATCHC) && \ + defined(HAVE_DECL_GLOB_NOMATCH) && HAVE_DECL_GLOB_NOMATCH != 0 # include #endif #ifdef HAVE_ENDIAN_H diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index ec16b1108..b3dd2b171 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -47,7 +47,8 @@ #include #if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) + !defined(GLOB_HAS_GL_MATCHC) || \ + !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0 static long get_arg_max(void) diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 4fdbfc1ea..9ba07f76e 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -38,7 +38,8 @@ /* OPENBSD ORIGINAL: include/glob.h */ #if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) + !defined(GLOB_HAS_GL_MATCHC) || \ + !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0 #ifndef _GLOB_H_ #define _GLOB_H_ -- cgit v1.2.3 From 25fa0ee693fc99377e395bf47d74960ffda20883 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 2 Sep 2006 12:38:56 +1000 Subject: - (dtucker) [openbsd-compat/port-irix.c] Add errno.h, found by Iain Morgan. --- ChangeLog | 5 ++++- openbsd-compat/port-irix.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index fb9f971a3..f1732345c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060902 + - (dtucker) [openbsd-compat/port-irix.c] Add errno.h, found by Iain Morgan. + 20060901 - (djm) [audit-bsm.c audit.c auth-bsdauth.c auth-chall.c auth-pam.c] [auth-rsa.c auth-shadow.c auth-sia.c auth1.c auth2-chall.c] @@ -5377,4 +5380,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4525 2006/09/01 11:32:53 dtucker Exp $ +$Id: ChangeLog,v 1.4526 2006/09/02 02:38:56 dtucker Exp $ diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c index eaa91a4b5..ba751a538 100644 --- a/openbsd-compat/port-irix.c +++ b/openbsd-compat/port-irix.c @@ -29,8 +29,9 @@ defined(WITH_IRIX_JOBS) || \ defined(WITH_IRIX_ARRAY) -#include +#include #include +#include #ifdef WITH_IRIX_PROJECT # include -- cgit v1.2.3 From 46aa3e0ce1d2f341bb3e4d46035faae3bb5ee69c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 2 Sep 2006 15:32:40 +1000 Subject: - (dtucker) [ssh-keyscan.c ssh-rand-helper.c ssh.c sshconnect.c openbsd-compat/bindresvport.c openbsd-compat/getrrsetbyname.c openbsd-compat/port-tun.c openbsd-compat/rresvport.c] Include for hton* and ntoh* macros. Required on (at least) HP-UX since we define _XOPEN_SOURCE_EXTENDED. Found by santhi.amirta at gmail com. --- ChangeLog | 7 ++++++- openbsd-compat/bindresvport.c | 1 + openbsd-compat/getrrsetbyname.c | 3 +++ openbsd-compat/port-tun.c | 2 ++ openbsd-compat/rresvport.c | 1 + ssh-keyscan.c | 3 +++ ssh-rand-helper.c | 1 + ssh.c | 3 +++ sshconnect.c | 1 + 9 files changed, 21 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index f1732345c..56b4af7c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 20060902 - (dtucker) [openbsd-compat/port-irix.c] Add errno.h, found by Iain Morgan. + - (dtucker) [ssh-keyscan.c ssh-rand-helper.c ssh.c sshconnect.c + openbsd-compat/bindresvport.c openbsd-compat/getrrsetbyname.c + openbsd-compat/port-tun.c openbsd-compat/rresvport.c] Include + for hton* and ntoh* macros. Required on (at least) HP-UX since we define + _XOPEN_SOURCE_EXTENDED. Found by santhi.amirta at gmail com. 20060901 - (djm) [audit-bsm.c audit.c auth-bsdauth.c auth-chall.c auth-pam.c] @@ -5380,4 +5385,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4526 2006/09/02 02:38:56 dtucker Exp $ +$Id: ChangeLog,v 1.4527 2006/09/02 05:32:40 dtucker Exp $ diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index e8fb83f23..65afed1e3 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -37,6 +37,7 @@ #include #include +#include #include #include diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 40155d5ab..6c86e02c2 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -52,6 +52,9 @@ #include #include +#include +#include + #include "getrrsetbyname.h" #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c index cadc331e1..276474db8 100644 --- a/openbsd-compat/port-tun.c +++ b/openbsd-compat/port-tun.c @@ -18,7 +18,9 @@ #include #include + #include +#include #include #include diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index 17e66ca59..5b0275ce0 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -39,6 +39,7 @@ #include #include +#include #include #include diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 64d4d0870..416d3f5c1 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -15,6 +15,9 @@ # include #endif +#include +#include + #include #include diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index 10c9905b1..8520c3a62 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -34,6 +34,7 @@ #include #include +#include #ifdef HAVE_SYS_UN_H # include diff --git a/ssh.c b/ssh.c index a34990b54..efc4af6d4 100644 --- a/ssh.c +++ b/ssh.c @@ -67,6 +67,9 @@ #include #include +#include +#include + #include #include diff --git a/sshconnect.c b/sshconnect.c index 823def6a9..a7a4e8a96 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -24,6 +24,7 @@ #endif #include +#include #include #include -- cgit v1.2.3 From ed0b59218ef9bb41a25922885d3fae7e67b8ba04 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 3 Sep 2006 22:44:49 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/openbsd-compat.h] Check for declaration of writev(2) and declare it ourselves if necessary. Makes the atomiciov() calls build on really old systems. ok djm@ --- ChangeLog | 7 ++++++- configure.ac | 10 ++++++++-- openbsd-compat/openbsd-compat.h | 7 ++++++- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 56b4af7c4..7cdcbf091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20060903 + - (dtucker) [configure.ac openbsd-compat/openbsd-compat.h] Check for + declaration of writev(2) and declare it ourselves if necessary. Makes + the atomiciov() calls build on really old systems. ok djm@ + 20060902 - (dtucker) [openbsd-compat/port-irix.c] Add errno.h, found by Iain Morgan. - (dtucker) [ssh-keyscan.c ssh-rand-helper.c ssh.c sshconnect.c @@ -5385,4 +5390,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4527 2006/09/02 05:32:40 dtucker Exp $ +$Id: ChangeLog,v 1.4528 2006/09/03 12:44:49 dtucker Exp $ diff --git a/configure.ac b/configure.ac index c37d7f499..cdabbd8a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.357 2006/09/01 10:29:11 dtucker Exp $ +# $Id: configure.ac,v 1.358 2006/09/03 12:44:49 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.357 $) +AC_REVISION($Revision: 1.358 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -1328,6 +1328,12 @@ AC_CHECK_DECLS(O_NONBLOCK, , , #endif ]) +AC_CHECK_DECLS(writev, , , [ +#include +#include +#include + ]) + AC_CHECK_FUNCS(setresuid, [ dnl Some platorms have setresuid that isn't implemented, test for this AC_MSG_CHECKING(if setresuid seems to work) diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 278ac71d9..aac2e6cbc 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.41 2006/08/30 17:24:42 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.42 2006/09/03 12:44:50 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -131,6 +131,11 @@ int getgrouplist(const char *, gid_t, gid_t *, int *); int BSDgetopt(int argc, char * const *argv, const char *opts); #endif +#if defined(HAVE_DECL_WRITEV) && HAVE_DECL_WRITEV == 0 +# include +# include +int writev(int, struct iovec *, int); +#endif /* Home grown routines */ #include "bsd-misc.h" -- cgit v1.2.3 From 08432d54faf63a2f5f9c264ac8ff6aa343ebeabc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 9 Sep 2006 15:59:43 +1000 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Add stdarg.h. --- ChangeLog | 5 ++++- openbsd-compat/bsd-snprintf.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 818cb9774..ead33c85b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20060909 + - (dtucker) [openbsd-compat/bsd-snprintf.c] Add stdarg.h. + 20060908 - (dtucker) [auth-sia.c] Add includes required for build on Tru64. Patch from Chris Adams. @@ -5415,4 +5418,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4537 2006/09/08 15:05:21 dtucker Exp $ +$Id: ChangeLog,v 1.4538 2006/09/09 05:59:43 dtucker Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 47cbcff67..04651e1d4 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -109,6 +109,7 @@ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) #include +#include #include #include -- cgit v1.2.3 From c70ce7b09d8fd0b341c33e1b8d584a91bb241547 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 18 Sep 2006 23:54:32 +1000 Subject: - (dtucker) [openbsd-compat/port-aix.{c,h}] Reduce scope of includes. Prevents macro redefinition warnings of "RDONLY". --- ChangeLog | 4 +++- openbsd-compat/port-aix.c | 10 ++++++++++ openbsd-compat/port-aix.h | 14 +------------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index f3d8d49ff..e43185568 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags. Allows build out of the box with older VAC and XLC compilers. Found by David Bronder and Bernhard Simon. + - (dtucker) [openbsd-compat/port-aix.{c,h}] Reduce scope of includes. + Prevents macro redefinition warnings of "RDONLY". 20060916 - OpenBSD CVS Sync @@ -5455,4 +5457,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4551 2006/09/18 13:17:40 dtucker Exp $ +$Id: ChangeLog,v 1.4552 2006/09/18 13:54:32 dtucker Exp $ diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index d0a423005..b9fabf61f 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -45,6 +45,16 @@ #include #include #include + +#ifdef WITH_AIXAUTHENTICATE +# include +# include +# if defined(HAVE_SYS_AUDIT_H) && defined(AIX_LOGINFAILED_4ARG) +# include +# endif +# include +#endif + #include "port-aix.h" # ifdef HAVE_SETAUTHDB diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index 37b2c12b0..5a04bedad 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h @@ -1,4 +1,4 @@ -/* $Id: port-aix.h,v 1.26 2005/05/28 10:28:40 dtucker Exp $ */ +/* $Id: port-aix.h,v 1.27 2006/09/18 13:54:33 dtucker Exp $ */ /* * @@ -31,18 +31,6 @@ #ifdef HAVE_SYS_SOCKET_H # include #endif -#ifdef HAVE_UNISTD_H -# include /* for seteuid() */ -#endif - -#ifdef WITH_AIXAUTHENTICATE -# include -# include -# if defined(HAVE_SYS_AUDIT_H) && defined(AIX_LOGINFAILED_4ARG) -# include -# endif -# include -#endif #include "buffer.h" -- cgit v1.2.3 From 4d13ecea54da655dd87152752f332f25785a1e18 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 1 Nov 2006 10:28:49 +1100 Subject: - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr events fatal in Solaris process contract support and tell it to signal only processes in the same process group when something happens. Based on information from andrew.benham at thus.net and similar to a patch from Chad Mynhier. ok djm@ --- ChangeLog | 9 ++++++++- openbsd-compat/port-solaris.c | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index cd99664cd..d02ba367e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +20061101 + - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr + events fatal in Solaris process contract support and tell it to signal + only processes in the same process group when something happens. + Based on information from andrew.benham at thus.net and similar to + a patch from Chad Mynhier. ok djm@ + 20061027 - (djm) [auth.c] gc some dead code @@ -2571,4 +2578,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4580 2006/10/27 15:10:15 djm Exp $ +$Id: ChangeLog,v 1.4581 2006/10/31 23:28:49 dtucker Exp $ diff --git a/openbsd-compat/port-solaris.c b/openbsd-compat/port-solaris.c index f57433e78..2ab64d487 100644 --- a/openbsd-compat/port-solaris.c +++ b/openbsd-compat/port-solaris.c @@ -1,4 +1,4 @@ -/* $Id: port-solaris.c,v 1.2 2006/09/01 05:38:41 djm Exp $ */ +/* $Id: port-solaris.c,v 1.3 2006/10/31 23:28:49 dtucker Exp $ */ /* * Copyright (c) 2006 Chad Mynhier. @@ -86,18 +86,27 @@ solaris_contract_pre_fork(void) debug2("%s: setting up process contract template on fd %d", __func__, tmpl_fd); - /* We have to set certain attributes before activating the template */ - if (ct_pr_tmpl_set_fatal(tmpl_fd, - CT_PR_EV_HWERR|CT_PR_EV_SIGNAL|CT_PR_EV_CORE) != 0) { + /* First we set the template parameters and event sets. */ + if (ct_pr_tmpl_set_param(tmpl_fd, CT_PR_PGRPONLY) != 0) { + error("%s: Error setting process contract parameter set " + "(pgrponly): %s", __func__, strerror(errno)); + goto fail; + } + if (ct_pr_tmpl_set_fatal(tmpl_fd, CT_PR_EV_HWERR) != 0) { error("%s: Error setting process contract template " "fatal events: %s", __func__, strerror(errno)); goto fail; } - if (ct_tmpl_set_critical(tmpl_fd, CT_PR_EV_HWERR) != 0) { + if (ct_tmpl_set_critical(tmpl_fd, 0) != 0) { error("%s: Error setting process contract template " "critical events: %s", __func__, strerror(errno)); goto fail; } + if (ct_tmpl_set_informative(tmpl_fd, CT_PR_EV_HWERR) != 0) { + error("%s: Error setting process contract template " + "informative events: %s", __func__, strerror(errno)); + goto fail; + } /* Now make this the active template for this process. */ if (ct_tmpl_activate(tmpl_fd) != 0) { -- cgit v1.2.3 From be6db83462c0d4a7067ab303644440026c93d685 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 5 Dec 2006 22:58:09 +1100 Subject: - (djm) [bsd-asprintf.c] Better test for bad vsnprintf lengths; ok dtucker@ --- ChangeLog | 3 ++- openbsd-compat/bsd-asprintf.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index a790a988d..c14cf03d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - (djm) [auth.c] Fix NULL pointer dereference in fakepw(). Crash would occur if the server did not have the privsep user and an invalid user tried to login and both privsep and krb5 auth are disabled; ok dtucker@ + - (djm) [bsd-asprintf.c] Better test for bad vsnprintf lengths; ok dtucker@ 20061108 - (dtucker) OpenBSD CVS Sync @@ -2616,4 +2617,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4590 2006/12/04 22:08:54 djm Exp $ +$Id: ChangeLog,v 1.4591 2006/12/05 11:58:09 djm Exp $ diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c index 67480139e..00fa0dfd8 100644 --- a/openbsd-compat/bsd-asprintf.c +++ b/openbsd-compat/bsd-asprintf.c @@ -39,7 +39,8 @@ #define INIT_SZ 128 -int vasprintf(char **str, const char *fmt, va_list ap) +int +vasprintf(char **str, const char *fmt, va_list ap) { int ret = -1; va_list ap2; @@ -53,7 +54,7 @@ int vasprintf(char **str, const char *fmt, va_list ap) ret = vsnprintf(string, INIT_SZ, fmt, ap2); if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */ *str = string; - } else if (ret == INT_MAX) { /* shouldn't happen */ + } else if (ret == INT_MAX || ret < 0) { /* Bad length */ goto fail; } else { /* bigger than initial, realloc allowing for nul */ len = (size_t)ret + 1; -- cgit v1.2.3 From 742cc1c19420db71275d3e8ef9fb86d96a463a4b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 14 Jan 2007 21:20:30 +1100 Subject: - (djm) [openbsd-compat/bsd-snprintf.c] Fix integer overflow in return value of snprintf replacement, similar to bugs in various libc implementations. This overflow is not exploitable in OpenSSH. While I'm fiddling with it, make it a fair bit faster by inlining the append-char routine; ok dtucker@ --- ChangeLog | 7 +- openbsd-compat/bsd-snprintf.c | 164 ++++++++++++++++++++++++++---------------- 2 files changed, 107 insertions(+), 64 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index bad97ecf0..7682c5c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 20070114 - (dtucker) [ssh-keygen.c] av -> argv to match earlier sync. + - (djm) [openbsd-compat/bsd-snprintf.c] Fix integer overflow in return + value of snprintf replacement, similar to bugs in various libc + implementations. This overflow is not exploitable in OpenSSH. + While I'm fiddling with it, make it a fair bit faster by inlining the + append-char routine; ok dtucker@ 20070105 - (djm) OpenBSD CVS Sync @@ -2664,4 +2669,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4604 2007/01/13 23:26:25 dtucker Exp $ +$Id: ChangeLog,v 1.4605 2007/01/14 10:20:30 djm Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 04651e1d4..cefb1d1ad 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -85,6 +85,11 @@ * * Move #endif to make sure VA_COPY, LDOUBLE, etc are defined even * if the C library has some snprintf functions already. + * + * Damien Miller (djm@mindrot.org) Jan 2007 + * Fix integer overflows in return value. + * Make formatting quite a bit faster by inlining dopr_outch() + * **************************************************************/ #include "includes.h" @@ -112,6 +117,8 @@ #include #include #include +#include +#include #ifdef HAVE_LONG_DOUBLE # define LDOUBLE long double @@ -159,17 +166,27 @@ # define MAX(p,q) (((p) >= (q)) ? (p) : (q)) #endif -static size_t dopr(char *buffer, size_t maxlen, const char *format, - va_list args_in); -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max); -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - LLONG value, int base, int min, int max, int flags); -static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags); -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); - -static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) +#define DOPR_OUTCH(buf, pos, buflen, thechar) \ + do { \ + if (++pos >= INT_MAX) { \ + errno = ERANGE; \ + return -1; \ + if (pos < buflen) \ + buf[pos] = thechar; \ + } \ + } while (0) + +static int dopr(char *buffer, size_t maxlen, const char *format, + va_list args_in); +static int fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max); +static int fmtint(char *buffer, size_t *currlen, size_t maxlen, + LLONG value, int base, int min, int max, int flags); +static int fmtfp(char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags); + +static int +dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) { char ch; LLONG value; @@ -198,8 +215,8 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args case DP_S_DEFAULT: if (ch == '%') state = DP_S_FLAGS; - else - dopr_outch (buffer, &currlen, maxlen, ch); + else + DOPR_OUTCH(buffer, currlen, maxlen, ch); ch = *format++; break; case DP_S_FLAGS: @@ -298,7 +315,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = va_arg (args, LLONG); else value = va_arg (args, int); - fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, + value, 10, min, max, flags) == -1) + return -1; break; case 'o': flags |= DP_F_UNSIGNED; @@ -310,7 +329,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (long)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 8, min, max, flags) == -1) + return -1; break; case 'u': flags |= DP_F_UNSIGNED; @@ -322,7 +343,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 10, min, max, flags) == -1) + return -1; break; case 'X': flags |= DP_F_UP; @@ -336,15 +359,18 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); - fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, value, + 16, min, max, flags) == -1) + return -1; break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - /* um, floating point? */ - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'E': flags |= DP_F_UP; @@ -353,7 +379,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'G': flags |= DP_F_UP; @@ -362,10 +390,13 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); - fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + if (fmtfp(buffer, &currlen, maxlen, fvalue, + min, max, flags) == -1) + return -1; break; case 'c': - dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + DOPR_OUTCH(buffer, currlen, maxlen, + va_arg (args, int)); break; case 's': strvalue = va_arg (args, char *); @@ -374,11 +405,15 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args max = strlen(strvalue); } if (min > 0 && max >= 0 && min > max) max = min; - fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); + if (fmtstr(buffer, &currlen, maxlen, + strvalue, flags, min, max) == -1) + return -1; break; case 'p': strvalue = va_arg (args, void *); - fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); + if (fmtint(buffer, &currlen, maxlen, + (long) strvalue, 16, min, max, flags) == -1) + return -1; break; case 'n': if (cflags == DP_C_SHORT) { @@ -400,7 +435,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args } break; case '%': - dopr_outch (buffer, &currlen, maxlen, ch); + DOPR_OUTCH(buffer, currlen, maxlen, ch); break; case 'w': /* not supported yet, treat as next char */ @@ -429,11 +464,12 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args buffer[maxlen - 1] = '\0'; } - return currlen; + return currlen < INT_MAX ? (int)currlen : -1; } -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max) +static int +fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max) { int padlen, strln; /* amount to pad */ int cnt = 0; @@ -453,24 +489,26 @@ static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, padlen = -padlen; /* Left Justify */ while ((padlen > 0) && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --padlen; ++cnt; } while (*value && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, *value++); + DOPR_OUTCH(buffer, *currlen, maxlen, *value++); ++cnt; } while ((padlen < 0) && (cnt < max)) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++padlen; ++cnt; } + return 0; } /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, +static int +fmtint(char *buffer, size_t *currlen, size_t maxlen, LLONG value, int base, int min, int max, int flags) { int signvalue = 0; @@ -527,31 +565,32 @@ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, /* Spaces */ while (spadlen > 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --spadlen; } /* Sign */ if (signvalue) - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); /* Zeros */ if (zpadlen > 0) { while (zpadlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --zpadlen; } } /* Digits */ while (place > 0) - dopr_outch (buffer, currlen, maxlen, convert[--place]); + DOPR_OUTCH(buffer, *currlen, maxlen, convert[--place]); /* Left Justified spaces */ while (spadlen < 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++spadlen; } + return 0; } static LDOUBLE abs_val(LDOUBLE value) @@ -564,13 +603,13 @@ static LDOUBLE abs_val(LDOUBLE value) return result; } -static LDOUBLE POW10(int exp) +static LDOUBLE POW10(int val) { LDOUBLE result = 1; - while (exp) { + while (val) { result *= 10; - exp--; + val--; } return result; @@ -604,7 +643,10 @@ static double my_modf(double x0, double *iptr) } if (i == 100) { - /* yikes! the number is beyond what we can handle. What do we do? */ + /* + * yikes! the number is beyond what we can handle. + * What do we do? + */ (*iptr) = 0; return 0; } @@ -623,8 +665,9 @@ static double my_modf(double x0, double *iptr) } -static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags) +static int +fmtfp (char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags) { int signvalue = 0; double ufvalue; @@ -729,24 +772,24 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); --padlen; signvalue = 0; } while (padlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --padlen; } } while (padlen > 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); --padlen; } if (signvalue) - dopr_outch (buffer, currlen, maxlen, signvalue); + DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); while (iplace > 0) - dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); + DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[--iplace]); #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); @@ -757,41 +800,37 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, * char to print out. */ if (max > 0) { - dopr_outch (buffer, currlen, maxlen, '.'); + DOPR_OUTCH(buffer, *currlen, maxlen, '.'); while (zpadlen > 0) { - dopr_outch (buffer, currlen, maxlen, '0'); + DOPR_OUTCH(buffer, *currlen, maxlen, '0'); --zpadlen; } while (fplace > 0) - dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); + DOPR_OUTCH(buffer, *currlen, maxlen, + fconvert[--fplace]); } while (padlen < 0) { - dopr_outch (buffer, currlen, maxlen, ' '); + DOPR_OUTCH(buffer, *currlen, maxlen, ' '); ++padlen; } -} - -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) -{ - if (*currlen < maxlen) { - buffer[(*currlen)] = c; - } - (*currlen)++; + return 0; } #endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ #if !defined(HAVE_VSNPRINTF) -int vsnprintf (char *str, size_t count, const char *fmt, va_list args) +static int +vsnprintf (char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); } #endif #if !defined(HAVE_SNPRINTF) -int snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) +static int +snprintf(char *str, size_t count, const char *fmt, ...) { size_t ret; va_list ap; @@ -802,4 +841,3 @@ int snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) return ret; } #endif - -- cgit v1.2.3 From 07877ca68066593473fbe29dd309dcdc61b6d629 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 24 Jan 2007 00:07:29 +1100 Subject: - (dtucker) [openbsd-compat/bsd-snprintf.c] Static declarations for public library interfaces aren't very helpful. Fix up the DOPR_OUTCH macro so it works properly and modify its callers so that they don't pre or post decrement arguments that are conditionally evaluated. While there, put SNPRINTF_CONST back as it prevents build failures in some configurations. ok djm@ (for most of it) --- ChangeLog | 10 +++++++++- openbsd-compat/bsd-snprintf.c | 33 ++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 14 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index dd8bd3561..7dd2e4ab8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +20070123 + - (dtucker) [openbsd-compat/bsd-snprintf.c] Static declarations for public + library interfaces aren't very helpful. Fix up the DOPR_OUTCH macro + so it works properly and modify its callers so that they don't pre or + post decrement arguments that are conditionally evaluated. While there, + put SNPRINTF_CONST back as it prevents build failures in some + configurations. ok djm@ (for most of it) + 20070122 - (djm) [ssh-rand-helper.8] manpage nits; from dleonard AT vintela.com (bz#1529) @@ -2678,4 +2686,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4607 2007/01/22 01:44:53 djm Exp $ +$Id: ChangeLog,v 1.4608 2007/01/23 13:07:29 dtucker Exp $ diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index cefb1d1ad..41d2be238 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -168,12 +168,13 @@ #define DOPR_OUTCH(buf, pos, buflen, thechar) \ do { \ - if (++pos >= INT_MAX) { \ + if (pos + 1 >= INT_MAX) { \ errno = ERANGE; \ return -1; \ + } \ if (pos < buflen) \ buf[pos] = thechar; \ - } \ + (pos)++; \ } while (0) static int dopr(char *buffer, size_t maxlen, const char *format, @@ -494,7 +495,8 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen, ++cnt; } while (*value && (cnt < max)) { - DOPR_OUTCH(buffer, *currlen, maxlen, *value++); + DOPR_OUTCH(buffer, *currlen, maxlen, *value); + *value++; ++cnt; } while ((padlen < 0) && (cnt < max)) { @@ -582,8 +584,10 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, } /* Digits */ - while (place > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, convert[--place]); + while (place > 0) { + --place; + DOPR_OUTCH(buffer, *currlen, maxlen, convert[place]); + } /* Left Justified spaces */ while (spadlen < 0) { @@ -788,8 +792,10 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, if (signvalue) DOPR_OUTCH(buffer, *currlen, maxlen, signvalue); - while (iplace > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[--iplace]); + while (iplace > 0) { + --iplace; + DOPR_OUTCH(buffer, *currlen, maxlen, iconvert[iplace]); + } #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); @@ -807,9 +813,10 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, --zpadlen; } - while (fplace > 0) - DOPR_OUTCH(buffer, *currlen, maxlen, - fconvert[--fplace]); + while (fplace > 0) { + --fplace; + DOPR_OUTCH(buffer, *currlen, maxlen, fconvert[fplace]); + } } while (padlen < 0) { @@ -821,7 +828,7 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, #endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ #if !defined(HAVE_VSNPRINTF) -static int +int vsnprintf (char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); @@ -829,8 +836,8 @@ vsnprintf (char *str, size_t count, const char *fmt, va_list args) #endif #if !defined(HAVE_SNPRINTF) -static int -snprintf(char *str, size_t count, const char *fmt, ...) +int +snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...) { size_t ret; va_list ap; -- cgit v1.2.3 From 89ee69e3c639b55b7577ba8fde66450446f74ea4 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 19 Feb 2007 22:56:55 +1100 Subject: - (dtucker) [openbsd-compat/getrrsetbyname.c] Don't attempt to calloc an array for signatures when there are none since "calloc(0, n) returns NULL on some platforms (eg Tru64), which is explicitly permitted by POSIX. Diagnosis and patch by svallet genoscope.cns.fr. --- ChangeLog | 6 +++++- openbsd-compat/getrrsetbyname.c | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 6f01b02a3..434fcafd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,10 @@ offsite. ok djm@, man page bits ok jmc@ - (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some platforms don't have it. Patch from dleonard at vintela.com. + - (dtucker) [openbsd-compat/getrrsetbyname.c] Don't attempt to calloc + an array for signatures when there are none since "calloc(0, n) returns + NULL on some platforms (eg Tru64), which is explicitly permitted by + POSIX. Diagnosis and patch by svallet genoscope.cns.fr. 20070128 - (djm) [channels.c serverloop.c] Fix so-called "hang on exit" (bz #52) @@ -2738,4 +2742,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4618 2007/02/19 11:44:25 dtucker Exp $ +$Id: ChangeLog,v 1.4619 2007/02/19 11:56:55 dtucker Exp $ diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 6c86e02c2..07231d005 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -303,10 +303,12 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, } /* allocate memory for signatures */ - rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); - if (rrset->rri_sigs == NULL) { - result = ERRSET_NOMEMORY; - goto fail; + if (rrset->rri_nsigs > 0) { + rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); + if (rrset->rri_sigs == NULL) { + result = ERRSET_NOMEMORY; + goto fail; + } } /* copy answers & signatures */ -- cgit v1.2.3 From fd30986c927e66985ddc43b25794651c76ba477c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 5 Mar 2007 18:25:20 +1100 Subject: - (dtucker) [openbsd-compat/openssl-compat.h] Bug #1291: Work around a bug in OpenSSL 0.9.8e that prevents aes256-ctr, aes192-ctr and arcfour256 ciphers from working correctly (disconnects with "Bad packet length" errors) as found by Ben Harris. ok djm@ --- ChangeLog | 6 +++++- openbsd-compat/openssl-compat.h | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 3035eca05..188d04293 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ - (djm) [configure.ac] add a --without-openssl-header-check option to configure, as some platforms (OS X) ship OpenSSL headers whose version does not match that of the shipping library. ok dtucker@ + - (dtucker) [openbsd-compat/openssl-compat.h] Bug #1291: Work around a + bug in OpenSSL 0.9.8e that prevents aes256-ctr, aes192-ctr and arcfour256 + ciphers from working correctly (disconnects with "Bad packet length" + errors) as found by Ben Harris. ok djm@ 20070303 - (dtucker) [regress/agent-ptrace.sh] Make ttrace gdb error a little more @@ -2799,4 +2803,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4630 2007/03/05 00:51:27 djm Exp $ +$Id: ChangeLog,v 1.4631 2007/03/05 07:25:20 dtucker Exp $ diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index c582cd269..9b5ccff5f 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.6 2006/02/22 11:24:47 dtucker Exp $ */ +/* $Id: openssl-compat.h,v 1.7 2007/03/05 07:25:20 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -46,6 +46,11 @@ extern const EVP_CIPHER *evp_acss(void); # endif #endif +/* OpenSSL 0.9.8e returns cipher key len not context key len */ +#if (OPENSSL_VERSION_NUMBER == 0x0090805fL) +# define EVP_CIPHER_CTX_key_length(c) ((c)->key_len) +#endif + /* * We overload some of the OpenSSL crypto functions with ssh_* equivalents * which cater for older and/or less featureful OpenSSL version. -- cgit v1.2.3