Commit Graph

2796 Commits

Author SHA1 Message Date
knakahara cbf21dcddc fix typo. (does not affect actual operation, but confuses reader...)
The function is called when racoon receives SADB_X_MIGRATE pfkey message,
however the message is not used now. It was compatible code for KAME.
2017-11-09 08:34:50 +00:00
snj dd44830ed1 no more ssh1 code in openssh, so no use defining WITH_SSH1 2017-11-06 10:26:13 +00:00
christos d11ce9f101 PR/52604: Tatoku Ogaito: Fix x11 session forwarding. 2017-10-09 12:07:03 +00:00
joerg 030d2353db Mark do_ca_sign as dead. 2017-10-08 20:19:05 +00:00
christos 26b9f775ff define recallocarray locally. 2017-10-07 21:14:59 +00:00
christos 7a183406d0 merge conflicts. 2017-10-07 19:39:19 +00:00
christos 9340b371cb Potentially-incompatible changes
================================

This release includes a number of changes that may affect existing
configurations:

 * ssh(1): delete SSH protocol version 1 support, associated
   configuration options and documentation.

 * ssh(1)/sshd(8): remove support for the hmac-ripemd160 MAC.

 * ssh(1)/sshd(8): remove support for the arcfour, blowfish and CAST
   ciphers.

 * Refuse RSA keys <1024 bits in length and improve reporting for keys
   that do not meet this requirement.

 * ssh(1): do not offer CBC ciphers by default.

Changes since OpenSSH 7.5
=========================

This is primarily a bugfix release. It also contains substantial
internal refactoring.

Security
--------

 * sftp-server(8): in read-only mode, sftp-server was incorrectly
   permitting creation of zero-length files. Reported by Michal
   Zalewski.

New Features
------------

 * ssh(1): add RemoteCommand option to specify a command in the ssh
   config file instead of giving it on the client's command line. This
   allows the configuration file to specify the command that will be
   executed on the remote host.

 * sshd(8): add ExposeAuthInfo option that enables writing details of
   the authentication methods used (including public keys where
   applicable) to a file that is exposed via a $SSH_USER_AUTH
   environment variable in the subsequent session.

 * ssh(1): add support for reverse dynamic forwarding. In this mode,
   ssh will act as a SOCKS4/5 proxy and forward connections
   to destinations requested by the remote SOCKS client. This mode
   is requested using extended syntax for the -R and RemoteForward
   options and, because it is implemented solely at the client,
   does not require the server be updated to be supported.

 * sshd(8): allow LogLevel directive in sshd_config Match blocks;
   bz#2717

 * ssh-keygen(1): allow inclusion of arbitrary string or flag
   certificate extensions and critical options.

 * ssh-keygen(1): allow ssh-keygen to use a key held in ssh-agent as
   a CA when signing certificates. bz#2377

 * ssh(1)/sshd(8): allow IPQoS=none in ssh/sshd to not set an explicit
   ToS/DSCP value and just use the operating system default.

 * ssh-add(1): added -q option to make ssh-add quiet on success.

 * ssh(1): expand the StrictHostKeyChecking option with two new
   settings. The first "accept-new" will automatically accept
   hitherto-unseen keys but will refuse connections for changed or
   invalid hostkeys. This is a safer subset of the current behaviour
   of StrictHostKeyChecking=no. The second setting "off", is a synonym
   for the current behaviour of StrictHostKeyChecking=no: accept new
   host keys, and continue connection for hosts with incorrect
   hostkeys. A future release will change the meaning of
   StrictHostKeyChecking=no to the behaviour of "accept-new". bz#2400

 * ssh(1): add SyslogFacility option to ssh(1) matching the equivalent
   option in sshd(8). bz#2705

Bugfixes
--------

 * ssh(1): use HostKeyAlias if specified instead of hostname for
   matching host certificate principal names; bz#2728

 * sftp(1): implement sorting for globbed ls; bz#2649

 * ssh(1): add a user@host prefix to client's "Permission denied"
   messages, useful in particular when using "stacked" connections
   (e.g. ssh -J) where it's not clear which host is denying. bz#2720

 * ssh(1): accept unknown EXT_INFO extension values that contain \0
   characters. These are legal, but would previously cause fatal
   connection errors if received.

 * ssh(1)/sshd(8): repair compression statistics printed at
   connection exit

 * sftp(1): print '?' instead of incorrect link count (that the
   protocol doesn't provide) for remote listings. bz#2710

 * ssh(1): return failure rather than fatal() for more cases during
   session multiplexing negotiations. Causes the session to fall back
   to a non-mux connection if they occur. bz#2707

 * ssh(1): mention that the server may send debug messages to explain
   public key authentication problems under some circumstances; bz#2709

 * Translate OpenSSL error codes to better report incorrect passphrase
   errors when loading private keys; bz#2699

 * sshd(8): adjust compatibility patterns for WinSCP to correctly
   identify versions that implement only the legacy DH group exchange
   scheme. bz#2748

 * ssh(1): print the "Killed by signal 1" message only at LogLevel
   verbose so that it is not shown at the default level; prevents it
   from appearing during ssh -J and equivalent ProxyCommand configs.
   bz#1906, bz#2744

 * ssh-keygen(1): when generating all hostkeys (ssh-keygen -A), clobber
   existing keys if they exist but are zero length. zero-length keys
   could previously be made if ssh-keygen failed or was interrupted part
   way through generating them. bz#2561

 * ssh(1): fix pledge(2) violation in the escape sequence "~&" used to
   place the current session in the background.

 * ssh-keyscan(1): avoid double-close() on file descriptors; bz#2734

 * sshd(8): avoid reliance on shared use of pointers shared between
   monitor and child sshd processes. bz#2704

 * sshd_config(8): document available AuthenticationMethods; bz#2453

 * ssh(1): avoid truncation in some login prompts; bz#2768

 * sshd(8): Fix various compilations failures, inc bz#2767

 * ssh(1): make "--" before the hostname terminate argument processing
   after the hostname too.

 * ssh-keygen(1): switch from aes256-cbc to aes256-ctr for encrypting
   new-style private keys. Fixes problems related to private key
   handling for no-OpenSSL builds. bz#2754

 * ssh(1): warn and do not attempt to use keys when the public and
   private halves do not match. bz#2737

 * sftp(1): don't print verbose error message when ssh disconnects
   from under sftp. bz#2750

 * sshd(8): fix keepalive scheduling problem: activity on a forwarded
   port from preventing the keepalive from being sent; bz#2756

 * sshd(8): when started without root privileges, don't require the
   privilege separation user or path to exist. Makes running the
   regression tests easier without touching the filesystem.

 * Make integrity.sh regression tests more robust against timeouts.
   bz#2658

 * ssh(1)/sshd(8): correctness fix for channels implementation: accept
   channel IDs greater than 0x7FFFFFFF.

Portability
-----------

 * sshd(9): drop two more privileges in the Solaris sandbox:
   PRIV_DAX_ACCESS and PRIV_SYS_IB_INFO; bz#2723

 * sshd(8): expose list of completed authentication methods to PAM
   via the SSH_AUTH_INFO_0 PAM environment variable. bz#2408

 * ssh(1)/sshd(8): fix several problems in the tun/tap forwarding code,
   mostly to do with host/network byte order confusion. bz#2735

 * Add --with-cflags-after and --with-ldflags-after configure flags to
   allow setting CFLAGS/LDFLAGS after configure has completed. These
   are useful for setting sanitiser/fuzzing options that may interfere
   with configure's operation.

 * sshd(8): avoid Linux seccomp violations on ppc64le over the
   socketcall syscall.

 * Fix use of ldns when using ldns-config; bz#2697

 * configure: set cache variables when cross-compiling. The cross-
   compiling fallback message was saying it assumed the test passed,
   but it wasn't actually set the cache variables and this would
   cause later tests to fail.

 * Add clang libFuzzer harnesses for public key parsing and signature
   verification.
2017-10-07 19:36:11 +00:00
christos d93fc8b9c8 fix lint build. 2017-10-05 18:01:00 +00:00
christos 4c1cde0e1e Use getpwuid_r instead of getpwuid, so that we don't trash getpw*() internal
buffers.

kde does (kdm/client/backend.c):
    p = getpwnam();
    pam_setcred() (which calls getpwuid in pam_afslog);
    setusercontext(...,p,p->pw_uid,...) (now with trashed p data...)

XXX: pullups.
2017-09-08 15:29:43 +00:00
christos 26bfd76729 This is why we have libroken... 2017-09-08 14:57:44 +00:00
christos 2be7a369ef always use rk_getpwnam_r... 2017-09-08 14:52:50 +00:00
christos afbc9755de PR/51682: Antoine Beaupré: Simplify and comment previous patch.
XXX: pullup-8
2017-07-23 05:40:27 +00:00
christos 3bf0a26b79 fix typo. 2017-07-11 21:52:54 +00:00
christos 5dd54c880f https://orpheus-lyre.info/design/index.html
6dd3eb836b

In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams.

XXX: pullup 6, 7, 8.
2017-07-11 17:45:31 +00:00
ozaki-r a607076325 Add update command for testing
Updating an SA (SADB_UPDATE) requires that a process issuing
SADB_UPDATE is the same as a process issued SADB_ADD (or SADB_GETSPI).
This means that update command must be used with add command in a
configuration of setkey. This usage is normally meaningless but
useful for testing (and debugging) purposes.
2017-07-05 01:22:40 +00:00
christos fc0e1a5a51 If we've authenticated, we are already in the child and we don't need the
socket anymore.
XXX: pullup-7, pullup-8
2017-06-26 17:10:39 +00:00
christos 8277ddc197 PR/52292: Shinichi Doyashiki: Fix reversed comments. 2017-06-11 22:12:56 +00:00
riastradh ef315f7931 Remove MKCRYPTO option.
Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
2017-05-21 15:28:36 +00:00
riastradh 1fa400f7fa Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2. 2017-05-21 14:24:05 +00:00
riastradh 09956316a6 Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.
This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate.  The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number          filing date
5,724,428       1995-11-01
5,835,600       1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html
2017-05-21 14:20:44 +00:00
ozaki-r 6aaeb7bc8b Print protocol number as well as its name
ex.) before: "reserved" -> after: "255(reserved)"

The original author is hsuenaga@IIJ
2017-04-26 03:19:49 +00:00
ozaki-r 2ea60f03d0 Correct the length of the SADB_EXT header in debug outputs
The length is shifted 3 bits in PF_KEY protocol.

Originally fixed by hsuenaga@IIJ
2017-04-26 03:16:06 +00:00
joerg fd4865e977 GC multistate_privsep. 2017-04-20 13:22:59 +00:00
christos b397962d38 fix conflict. 2017-04-19 15:34:25 +00:00
christos 62b22b0671 bump 2017-04-18 18:41:59 +00:00
christos 41768fc151 merge conflicts 2017-04-18 18:41:46 +00:00
agc 932ce0ffe2 libnetpgpverify major bump to 5 2017-04-17 23:38:51 +00:00
agc 32d959bfe0 Update netpgpverify sources in base from 20160617 to 20170201 (i.e. bring
over changes from master sources in pkgsrc/security/netpgpverify, version 20170201):

Changes:

Update netpgpverify (and libnetpgpverify) to 20160614
	+ handle signatures created by gpg with "--no-emit-version", don't assume
	there will always be a version string.
	+ add a test for above
	Fixes security PR  51240.
	Thanks to xnox@ubuntu.com for reporting the error

Update netpgpverify and libnetpgpverify to 20160615:
	Simplify the method of finding the end of the versioning information
	in the signature - back up to the "\n" character at the end of the
	signature start:

		"-----BEGIN PGP SIGNATURE-----\n"

	and then find the "\n\n" character sequence to denote the start of the
	signature itself. The previous version worked, but this is more efficient.

Update netpgpverify and libnetpgpverify to 20160616
	+ bring over joerg's printflike change from the netpgpverify
	version in src/crypto
	+ add a test for cleartext signatures with version information
	to complement the one with no version information

Update netpgpverify and libnetpgpverify to 20160622 during freeze to fix PR  51262
	+ take a bit of a step backwards, and don't use stdbool.h, just to appease
	Solaris 10 compiler

Update netpgpverify and libnetpgpverify to 20160623
	+ remove use of asprintf and vasprintf from libverify. Inspired
	by work from Dimitri John Ledkov. Should allow building on Linux
	without superfluous definitions.
	+ also free the BIGNUM struct in PGPV_BN_clear() - from Dimitri
	John Ledkov

Update netpgpverify and libnetpgpverify to 20160626
	+ make the pgpv_t and pgpv_cursor_t structures opaque
	+ add new accessor functions for fields in the pgpv_cursor_t struct
	+ add new creation functions for the pgpv_t and pgpv_cursor_t structs

Update netpgpverify and libnetpgpverify to 20160704
	+ get rid of redundant PGPV_ARRAY definition in libverify.c, brought in when
	the definitions moved from verify.h
	+ fix obuf_add_mem() to use a const void *, as any struct can be
	dumped using it
	+ remove redundant NO_SUBKEYS definition - unused
	+ add an (unused as yet) ARRAY_FREE() macro

Update netpgpverify and libnetpgpverify to 20160705
	External API changes
	====================
	+ add a pgpv_cursor_close() function to free resources associated with
	a cursor
	Better memory management
	========================
	+ restructure the way dynamic arrays are used, to avoid memory
	corruption issues and memory leaks - keep all dynamic arrays in the global
	data structure, and use indices in the other data structures to index them.
	Means lack of data localisation, but avoids stale pointers, and leaks.
	+ make signer field of signature a uint8_t array, rather than a pointer
	+ use our own version of strdup(3) - don't depend on it being
	available in standard library
	+ keep track of whether litdata filenames and userid were allocated or not,
	and free memory in pgpv_close() if it was allocated
	+ free up allocated resources which were allocated in pgpv_close()

Update netpgpverify and libnetpgpverify to 20160706
	+ 20160705 introduced a bug whereby a key subid would match and verify
	fine, but, if formatted, would not display the correct subkey
	information.  Fix to show the correct information in this case.

Update netpgpverify and libnetpgpverify to 20160707 to fix some
	unusual build errors shown by old gcc versions (works fine for
	gcc-5.2.1 on ubuntu and gcc-5.3.0 on NetBSD 7.99.32)
	+ use ULL suffix on unsigned 64bit constants, not UL
	+ don't typedef the public structs twice - second time just define it
	without the typedef
	Fixes PR   51327

Update netpgpverify and libnetpgpverify to 20160708
	+ clear and free bignums properly - helps immensely with plugging
	memory leaks

Update netpgpverify and libnetpgpverify to 20160828
	+ bring over change from christos in src/crypto to check for
	the end of an ASCII-armored signature
	+ no need for namespace protection in array.h any more, now
	that netpgp/verify.h now contains opaque structures
	+ minor typo clean-up in a definition (benign, ignored by compiler)

update netpgpverify and libnetpgpverify to 20170201
	+ make sure howmany() macro is defined
	pointed out by cube - thanks!
2017-04-17 19:50:27 +00:00
ozaki-r e27c60ccce Fix parsing ah without a key 2017-04-13 01:19:17 +00:00
roy fcede00eff Use RO_MSGFILTER. 2017-04-12 16:47:39 +00:00
khorben 020e2e0f6f No longer hard-code the suffix length
This will avoid a buffer overflow if the suffix changes; it is currently
hard-coded as either "asc" or "sig".

Submitted on tech-pkg@ as:
[PATCH 10/11] No longer hard-code the suffix length
2017-04-09 23:03:50 +00:00
khorben a4f591eb0f Output signatures to the standard output for "-"
This is to reflect the behaviour documented in netpgp(1).

Submitted on tech-pkg@ as:
[PATCH 09/11] Output signatures to the standard output for "-"

Only modified for consistency with the coding style.
2017-04-09 22:48:39 +00:00
khorben f263734bc2 Avoid a type cast
No functional change intended.
2017-04-09 22:44:34 +00:00
khorben fde99a469a Also document alternate option "--detach"
Submitted on tech-pkg@ as:
[PATCH 08/11] Also document alternate option "--detach"
2017-03-27 21:34:32 +00:00
khorben b73233e927 Correct option "--armor"
Submitted on tech-pkg@ as:
[PATCH 07/11] Correct option "--armor"
2017-03-27 21:30:23 +00:00
khorben 93af107a65 Do not ask for a passphrase when empty
Submitted on tech-pkg@ as:
[PATCH 06/11] Do not ask for a passphrase when empty

Only modified for consistency with the coding style.
2017-03-27 21:19:12 +00:00
khorben 0a8cffecb2 Expect a FILE * for pgp_decrypt_seckey()
Submitted on tech-pkg@ as:
[PATCH 05/11] Expect a FILE * for pgp_decrypt_seckey()

No functional change intended.
2017-03-27 21:06:50 +00:00
khorben dc6efa23ca Do not use random data for pass-phrases on EOF
Submitted on tech-pkg@ as:
[PATCH 04/11] Do not use random data for pass-phrases on EOF

Only modified for consistency with the coding style.
2017-03-27 21:00:43 +00:00
khorben e1d90c495a Avoid some type casts
Submitted on tech-pkg@ as:
[PATCH 03/11] Avoid some type casts

No functional change intended.
2017-03-27 20:55:13 +00:00
khorben 5a96e50edf Do not truncate pass-phrases without a newline character
This also fixes a crash when the pass-phrase entered is empty.

Submitted on tech-pkg@ as:
[PATCH 02/11] Do not truncate pass-phrases without a newline character

Only modified for consistency with the coding style.
2017-03-27 20:50:19 +00:00
khorben a3d226ca02 Revert "Remove a useless loop around getpass()"
getpass(3) may return NULL upon failures on Linux, and netpgp should remain
portable to other systems.
2017-02-24 01:26:17 +00:00
christos 6f030214f7 reproduced also on the regular (not -m32) build. 2017-02-21 16:07:17 +00:00
khorben b4c0f63794 Remove a useless loop around getpass()
According to getpass(3), this library function cannot return NULL.
Verified with a source code inspection.
2017-02-20 01:38:28 +00:00
khorben b07e8011d2 Remove a useless loop around getpass()
According to getpass(3), this library function cannot return NULL.
Verified with a source code inspection.
2017-02-20 01:33:28 +00:00
khorben 86dea4ede5 Do not crash when listing keys without a keyring
To test: (with an empty ~/.gnupg)
$ netpgpkeys --import-key /dev/null

Submitted on tech-pkg@ as:
[PATCH 01/11] Do not crash when listing keys without a keyring

Different patch for the same issue.
2017-02-20 00:51:08 +00:00
christos 0ac6b0daad PR/51973: Use proper fd for AuthorizedKeysCommand 2017-02-16 17:56:07 +00:00
rin 72128ffa3a also compile poly1305.c with -O0 on vax to address ssh login failure from/to
some hosts
2017-02-14 09:59:16 +00:00
rin 79ef876622 add hack for libssh on vax 2017-02-14 09:00:03 +00:00
christos 22e79776ca Add hack for profiling bimodal label generation with -m32 on sparc64 2017-02-11 04:56:37 +00:00
rin 484854fa22 Do not use the assembler version of AES routines for m68000; they contain
instructions available for 68020 and later.

Fix sun2 build.
2017-02-08 21:43:53 +00:00