Commit Graph

212 Commits

Author SHA1 Message Date
Darren Tucker 464ba22f1e Check compiler for c99 declarations after code.
The sntrup761 reference code contains c99-style declarations after code
so don't try to build that if the compiler doesn't support it.
2021-08-18 12:51:30 +10:00
Darren Tucker f5fc6a4c34 Add configure-time detection for SSH_TIME_T_MAX.
Should fix printing cert times exceeding INT_MAX (bz#3329) on platforms
were time_t is a long long.  The limit used is for the signed type, so if
some system has a 32bit unsigned time_t then the lower limit will still
be imposed and we would need to add some way to detect this.  Anyone using
an unsigned 64bit can let us know when it starts being a problem.
2021-07-12 18:21:26 +10:00
Darren Tucker 48d0d7a4dd Disable sntrup761 if compiler doesn't support VLAs.
The sntrup761 code sourced from supercop uses variable length
arrays.  Although widely supported, they are not part of the ANSI
C89 spec so if the compiler does not support VLAs, disable the
sntrup761x25519-sha512@openssh.com KEX method by replacing the kex
functions with no-op ones similar to what we do in kexecdh.c.

This should allow OpenSSH to build with a plain C89 compiler again.
Spotted by tim@, ok djm@.
2021-01-26 14:48:07 +11:00
Sebastian Andrzej Siewior 8372bff3a8 Remove HAVE_MMAP and BROKEN_MMAP
BROKEN_MMAP is no longer defined since commit
   1cfd5c06ef ("Remove portability support for mmap")

this commit also removed other HAVE_MMAP user. I didn't find anything
that defines HAVE_MMAP. The check does not trigger because compression
on server side is by default COMP_DELAYED (2) so it never triggers.

Remove remaining HAVE_MMAP and BROKEN_MMAP bits.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2020-09-11 13:18:42 +10:00
Darren Tucker e9dc986372 Use LONG_LONG_MAX and friends if available.
If we don't have LLONG_{MIN,MAX} but do have LONG_LONG_{MIN,MAX}
then use those instead.  We do calculate these values in configure,
but it turns out that at least one compiler (old HP ANSI C) can't
parse "-9223372036854775808LL" without mangling it. (It can parse
"-9223372036854775807LL" which is presumably why its limits.h defines
LONG_LONG_MIN as the latter minus 1.)

Fixes rekey test when compiled with the aforementioned compiler.
2020-05-01 18:41:40 +10:00
Darren Tucker 14ccfdb724 Check if UINT32_MAX is defined before redefining. 2020-02-09 11:23:35 +11:00
Damien Miller ec8a759b40 compat for missing IPTOS_DSCP_LE in system headers 2020-01-28 12:57:25 +11:00
Darren Tucker 0d11447691 Move definition of UINT32_MAX.
This allows us to always define it if needed not just if we also
define the type ourself.
2020-01-26 15:09:15 +11:00
Darren Tucker 134a74f4e0 Add SSIZE_MAX when we define ssize_t. 2019-11-15 18:55:13 +11:00
Darren Tucker 2912596aec Define UINT32_MAX if needed. 2019-10-28 16:27:53 +11:00
Darren Tucker 0c7f8d2326 Make DEF_WEAK more likely to be correct.
Completely nop-ing out DEF_WEAK leaves an empty statemment which some
compilers don't like.  Replace with a no-op function template.  ok djm@
2019-10-08 14:48:32 +11:00
Darren Tucker c1e0a32fa8 Add more ToS bits, currently only used by netcat. 2019-09-24 21:17:20 +10:00
Damien Miller 4efe1adf05 remove realpath() compat replacement
We shipped a BSD implementation of realpath() because sftp-server
depended on its behaviour.

OpenBSD is now moving to a more strictly POSIX-compliant realpath(2),
so sftp-server now unconditionally requires its own BSD-style realpath
implementation. As such, there is no need to carry another independant
implementation in openbsd-compat.

ok dtucker@
2019-07-08 13:38:39 +10:00
Damien Miller 87f08be054 Remove support for S/Key
Most people will 1) be using modern multi-factor authentication methods
like TOTP/OATH etc and 2) be getting support for multi-factor
authentication via PAM or BSD Auth.
2018-07-31 12:59:30 +10:00
Darren Tucker ddc0f38148 Remove UNICOS support.
The code required to support it is quite invasive to the mainline
code that is synced with upstream and is an ongoing maintenance burden.
Both the hardware and software are literal museum pieces these days and
we could not find anyone still running OpenSSH on one.
2018-02-15 20:04:02 +11:00
Damien Miller bcd1485075 portability for sftp globbed ls sort by mtime
Include replacement timespeccmp() for systems that lack it.
Support time_t struct stat->st_mtime in addition to
timespec stat->st_mtim, as well as unsorted fallback.
2017-06-10 23:41:25 +10:00
Darren Tucker d29ba6f450 Define INT32_MAX and INT64_MAX if needed. 2017-05-01 13:53:55 +10:00
Darren Tucker 032147b695 Move DEF_WEAK into defines.h.
As well pull in more recent changes from OpenBSD these will start to
arrive so put it where the definition is shared.
2016-10-15 05:51:12 +11:00
Darren Tucker 1e8013a17f Remove obsolete CVS $Id from source files.
Since -portable switched to git the CVS $Id tags are no longer being
updated and are becoming increasingly misleading.  Remove them.
2016-08-17 14:08:42 +10:00
Darren Tucker 353766e088 Move Cygwin IPPORT_RESERVED overrride to defines.h
Patch from vinschen at redhat.com.
2016-07-23 16:14:42 +10:00
Darren Tucker 8db134e7f4 Prevent name collisions with system glob (bz#2463)
Move glob.h from includes.h to the only caller (sftp) and override the
names for the symbols.  This prevents name collisions with the system glob
in the case where something other than ssh uses it (eg kerberos).  With
jjelen at redhat.com, ok djm@
2015-10-29 10:48:23 +11:00
Damien Miller d1bc844322 Revert "define __unused to nothing if not already defined"
This reverts commit 1598419e38.

Some system headers have objects named __unused
2015-03-04 06:31:45 +11:00
Damien Miller 1598419e38 define __unused to nothing if not already defined
fixes builds on BSD/OS
2015-03-04 04:59:13 +11:00
Darren Tucker 1734e276d9 Move definition of _NSIG.
_NSIG is only unsed in one file, so move it there prevent redefinition
warnings reported by Kevin Brott.
2015-02-25 13:40:45 +11:00
Damien Miller 38806bda6d include netdb.h to look for MAXHOSTNAMELEN; ok tim 2015-02-24 16:50:36 -08:00
Tim Rice 676c38d7cb portability fix: if we can't dind a better define for HOST_NAME_MAX, use 255 2015-02-23 21:51:33 -08:00
Darren Tucker 28ba006c1a More correct checking of HAVE_DECL_AI_NUMERICSERV. 2015-02-21 15:41:07 +11:00
Darren Tucker e50e8c97a9 Add null declaration of AI_NUMERICINFO.
Some platforms (older FreeBSD and DragonFly versions) do have
getaddrinfo() but do not have AI_NUMERICINFO. so define it to zero
in those cases.
2015-02-21 15:10:33 +11:00
Damien Miller a2c95c1bf3 OSX lacks HOST_NAME_MAX, has _POSIX_HOST_NAME_MAX 2015-01-27 23:06:59 +11:00
Damien Miller 23f269562b - (djm) [defines.h sshbuf.c] Move __predict_true|false to defines.h and
conditionalise to avoid duplicate definition.
2014-09-03 05:33:25 +10:00
Darren Tucker af665bb7b0 - (dtucker) [defines.h] Fix undef of _PATH_MAILDIR. From rak at debian via
OpenSMTPD and chl@
2014-06-16 22:50:55 +10:00
Darren Tucker cf5392c2db - (dtucker) [defines.h] Add va_copy if we don't already have it, taken from
openbsd-compat/bsd-asprintf.c.
2014-06-12 05:22:49 +10:00
Damien Miller 18912775cb - (djm) [commit configure.ac defines.h sshpty.c] don't attempt to use
vhangup on Linux. It doens't work for non-root users, and for them
   it just messes up the tty settings.
2014-05-21 17:06:46 +10:00
Damien Miller 686c7d9ee6 - djm@cvs.openbsd.org 2014/05/02 03:27:54
[chacha.h cipher-chachapoly.h digest.h hmac.h kex.h kexc25519.c]
     [misc.h poly1305.h ssh-pkcs11.c defines.h]
     revert __bounded change; it causes way more problems for portable than
     it solves; pointed out by dtucker@
2014-05-15 14:37:03 +10:00
Darren Tucker f028460d0b - (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already
have it.  Only attempt to use __attribute__(__bounded__) for gcc.
2014-05-01 02:24:35 +10:00
Damien Miller 4f40209aa4 - djm@cvs.openbsd.org 2014/03/26 04:55:35
[chacha.h cipher-chachapoly.h digest.h hmac.h kex.h kexc25519.c
     [misc.h poly1305.h ssh-pkcs11.c]
     use __bounded(...) attribute recently added to sys/cdefs.h instead of
     longform __attribute__(__bounded(...));

     for brevity and a warning free compilation with llvm/clang
2014-04-20 13:21:22 +10:00
Darren Tucker 355f861022 - (dtucker) [defines.h] Move our definitions of uintXX_t types down to after
they're defined if we have to define them ourselves.  Fixes builds on old
   AIX.
2014-01-18 00:12:38 +11:00
Darren Tucker acad351a5b - (dtucker) [defines.h] Add typedefs for uintXX_t types for platforms that
don't have them.
2014-01-17 14:20:05 +11:00
Damien Miller df8b030b15 - (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms
that lack it but have arc4random_uniform()
2013-11-07 13:28:16 +11:00
Darren Tucker 007e3b357e - (dtucker) [configure.ac defines.h] Add typedefs for intmax_t and uintmax_t
for platforms that don't have them.
2013-11-03 18:43:55 +11:00
Darren Tucker c7aad0058c - (dtucker) [configure.ac defines.h] Test for fd_mask, howmany and NFDBITS
rather than trying to enumerate the plaforms that don't have them.
   Based on a patch from Nathan Osman, with help from tim@.
2013-06-02 07:18:47 +10:00
Darren Tucker 9243ef086f - (dtucker) [defines.h] Remove SIZEOF_CHAR bits since the test for it is
was removed in configure.ac rev 1.481 as it was redundant.
2013-03-07 20:06:13 +11:00
Tim Rice 96ce9a1e45 20121205
- (tim) [defines.h] Some platforms are missing ULLONG_MAX. Feedback djm@.
2012-12-04 07:50:03 -08:00
Tim Rice f79b5d38a1 - (tim) [defines.h] move chunk introduced in 1.125 before MAXPATHLEN so
it actually works.
2012-02-14 20:13:05 -08:00
Damien Miller 5ffe1c4b43 - (djm) [configure.ac defines.h] No need to detect sizeof(char); patch
from des AT des.no
2011-09-29 11:11:51 +10:00
Tim Rice 90f42b0705 - (tim) [configure.ac defines.h] Run test program to detect system mail
directory. Add --with-maildir option to override. Fixed OpenServer 6
   getting it wrong. Fixed many systems having MAIL=/var/mail//username
   ok dtucker
2011-06-02 18:17:49 -07:00
Tim Rice 9abb697d4f - (tim) [defines.h] Deal with platforms that do not have S_IFSOCK ok djm@ 2011-05-04 23:06:59 -07:00
Damien Miller 68790fedef - (djm) [defines.h] Move up include of netinet/ip.h for IPTOS
definitions.
2011-05-05 11:19:13 +10:00
Darren Tucker ea52a82969 - (dtucker) [LICENCE Makefile.in audit-bsm.c audit-linux.c audit.c audit.h
configure.ac defines.h loginrec.c]  Bug #1402: add linux audit subsystem
   support, based on patches from Tomas Mraz and jchadima at redhat.
2011-01-17 21:15:27 +11:00
Damien Miller 73de86ac5a - (djm) [defines.h] Add IP DSCP defines 2010-11-24 10:50:04 +11:00