Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/OPENSSH]: src/crypto/external/bsd/openssh/dist OpenSSH 8.1 was released ...
details: https://anonhg.NetBSD.org/src/rev/8008c462b9fa
branches: OPENSSH
changeset: 455269:8008c462b9fa
user: christos <christos%NetBSD.org@localhost>
date: Sat Oct 12 15:13:53 2019 +0000
description:
OpenSSH 8.1 was released on 2019-10-09. It is available from the
mirrors listed at https://www.openssh.com/.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.
Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
http://www.openssh.com/donations.html
Security
========
* ssh(1), sshd(8), ssh-add(1), ssh-keygen(1): an exploitable integer
overflow bug was found in the private key parsing code for the XMSS
key type. This key type is still experimental and support for it is
not compiled by default. No user-facing autoconf option exists in
portable OpenSSH to enable it. This bug was found by Adam Zabrocki
and reported via SecuriTeam's SSD program.
* ssh(1), sshd(8), ssh-agent(1): add protection for private keys at
rest in RAM against speculation and memory side-channel attacks like
Spectre, Meltdown and Rambleed. This release encrypts private keys
when they are not in use with a symmetric key that is derived from a
relatively large "prekey" consisting of random data (currently 16KB).
Potentially-incompatible changes
================================
This release includes a number of changes that may affect existing
configurations:
* ssh-keygen(1): when acting as a CA and signing certificates with
an RSA key, default to using the rsa-sha2-512 signature algorithm.
Certificates signed by RSA keys will therefore be incompatible
with OpenSSH versions prior to 7.2 unless the default is
overridden (using "ssh-keygen -t ssh-rsa -s ...").
diffstat:
crypto/external/bsd/openssh/dist/PROTOCOL.sshsig | 99 +
crypto/external/bsd/openssh/dist/auth-options.c | 77 +-
crypto/external/bsd/openssh/dist/auth-options.h | 5 +-
crypto/external/bsd/openssh/dist/auth-rhosts.c | 11 +-
crypto/external/bsd/openssh/dist/auth.c | 18 +-
crypto/external/bsd/openssh/dist/auth.h | 4 +-
crypto/external/bsd/openssh/dist/auth2-chall.c | 3 +-
crypto/external/bsd/openssh/dist/auth2-hostbased.c | 3 +-
crypto/external/bsd/openssh/dist/auth2-kbdint.c | 5 +-
crypto/external/bsd/openssh/dist/auth2-passwd.c | 4 +-
crypto/external/bsd/openssh/dist/auth2-pubkey.c | 72 +-
crypto/external/bsd/openssh/dist/auth2.c | 6 +-
crypto/external/bsd/openssh/dist/authfd.c | 36 +-
crypto/external/bsd/openssh/dist/authfd.h | 5 +-
crypto/external/bsd/openssh/dist/authfile.c | 58 +-
crypto/external/bsd/openssh/dist/authfile.h | 7 +-
crypto/external/bsd/openssh/dist/canohost.c | 6 +-
crypto/external/bsd/openssh/dist/channels.c | 101 +-
crypto/external/bsd/openssh/dist/cipher.c | 5 +-
crypto/external/bsd/openssh/dist/cipher.h | 4 +-
crypto/external/bsd/openssh/dist/clientloop.c | 19 +-
crypto/external/bsd/openssh/dist/dh.c | 9 +-
crypto/external/bsd/openssh/dist/dh.h | 7 +-
crypto/external/bsd/openssh/dist/hmac.c | 3 +-
crypto/external/bsd/openssh/dist/hostfile.c | 9 +-
crypto/external/bsd/openssh/dist/kex.c | 105 +-
crypto/external/bsd/openssh/dist/kex.h | 16 +-
crypto/external/bsd/openssh/dist/kexgen.c | 8 +-
crypto/external/bsd/openssh/dist/krl.c | 5 +-
crypto/external/bsd/openssh/dist/krl.h | 4 +-
crypto/external/bsd/openssh/dist/log.h | 4 +-
crypto/external/bsd/openssh/dist/mac.c | 3 +-
crypto/external/bsd/openssh/dist/match.c | 4 +-
crypto/external/bsd/openssh/dist/misc.c | 139 ++-
crypto/external/bsd/openssh/dist/misc.h | 8 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.2048 | 186 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.3072 | 150 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.4096 | 146 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.6144 | 138 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.7680 | 146 +-
crypto/external/bsd/openssh/dist/moduli-gen/moduli.8192 | 134 +-
crypto/external/bsd/openssh/dist/moduli.c | 6 +-
crypto/external/bsd/openssh/dist/monitor.c | 12 +-
crypto/external/bsd/openssh/dist/monitor_wrap.c | 4 +-
crypto/external/bsd/openssh/dist/monitor_wrap.h | 4 +-
crypto/external/bsd/openssh/dist/mux.c | 8 +-
crypto/external/bsd/openssh/dist/nchan.c | 6 +-
crypto/external/bsd/openssh/dist/packet.c | 17 +-
crypto/external/bsd/openssh/dist/packet.h | 14 +-
crypto/external/bsd/openssh/dist/progressmeter.c | 6 +-
crypto/external/bsd/openssh/dist/readconf.c | 33 +-
crypto/external/bsd/openssh/dist/readpass.c | 10 +-
crypto/external/bsd/openssh/dist/scp.1 | 6 +-
crypto/external/bsd/openssh/dist/scp.c | 26 +-
crypto/external/bsd/openssh/dist/servconf.c | 30 +-
crypto/external/bsd/openssh/dist/servconf.h | 4 +-
crypto/external/bsd/openssh/dist/serverloop.c | 8 +-
crypto/external/bsd/openssh/dist/session.c | 48 +-
crypto/external/bsd/openssh/dist/sftp-client.c | 12 +-
crypto/external/bsd/openssh/dist/sftp-glob.c | 3 +-
crypto/external/bsd/openssh/dist/sftp-realpath.c | 224 ++++
crypto/external/bsd/openssh/dist/sftp-server-main.c | 3 +-
crypto/external/bsd/openssh/dist/sftp-server.c | 29 +-
crypto/external/bsd/openssh/dist/sftp.1 | 44 +-
crypto/external/bsd/openssh/dist/sftp.c | 29 +-
crypto/external/bsd/openssh/dist/ssh-add.c | 12 +-
crypto/external/bsd/openssh/dist/ssh-agent.c | 21 +-
crypto/external/bsd/openssh/dist/ssh-keygen.1 | 194 +++-
crypto/external/bsd/openssh/dist/ssh-keygen.c | 596 +++++++++--
crypto/external/bsd/openssh/dist/ssh-keyscan.c | 22 +-
crypto/external/bsd/openssh/dist/ssh-keysign.c | 13 +-
crypto/external/bsd/openssh/dist/ssh-pkcs11-helper.c | 25 +-
crypto/external/bsd/openssh/dist/ssh-pkcs11.c | 75 +-
crypto/external/bsd/openssh/dist/ssh.1 | 6 +-
crypto/external/bsd/openssh/dist/ssh.c | 37 +-
crypto/external/bsd/openssh/dist/ssh_api.c | 46 +-
crypto/external/bsd/openssh/dist/ssh_config.5 | 84 +-
crypto/external/bsd/openssh/dist/sshbuf-getput-basic.c | 164 +++-
crypto/external/bsd/openssh/dist/sshbuf-misc.c | 96 +-
crypto/external/bsd/openssh/dist/sshbuf.h | 62 +-
crypto/external/bsd/openssh/dist/sshconnect.c | 66 +-
crypto/external/bsd/openssh/dist/sshconnect.h | 9 +-
crypto/external/bsd/openssh/dist/sshconnect2.c | 43 +-
crypto/external/bsd/openssh/dist/sshd.c | 40 +-
crypto/external/bsd/openssh/dist/sshd_config.5 | 54 +-
crypto/external/bsd/openssh/dist/sshkey-xmss.c | 29 +-
crypto/external/bsd/openssh/dist/sshkey.c | 451 +++++++-
crypto/external/bsd/openssh/dist/sshkey.h | 31 +-
crypto/external/bsd/openssh/dist/sshlogin.c | 4 +-
crypto/external/bsd/openssh/dist/sshpty.c | 24 +-
crypto/external/bsd/openssh/dist/sshsig.c | 799 ++++++++++++++++
crypto/external/bsd/openssh/dist/sshsig.h | 92 +
crypto/external/bsd/openssh/dist/uidswap.c | 22 +-
crypto/external/bsd/openssh/dist/umac.h | 6 +-
crypto/external/bsd/openssh/dist/version.h | 4 +-
crypto/external/bsd/openssh/dist/xmalloc.c | 10 +-
crypto/external/bsd/openssh/dist/xmalloc.h | 3 +-
97 files changed, 4088 insertions(+), 1410 deletions(-)
diffs (truncated from 10343 to 300 lines):
diff -r 0784089e00fd -r 8008c462b9fa crypto/external/bsd/openssh/dist/PROTOCOL.sshsig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/external/bsd/openssh/dist/PROTOCOL.sshsig Sat Oct 12 15:13:53 2019 +0000
@@ -0,0 +1,99 @@
+This document describes a lightweight SSH Signature format
+that is compatible with SSH keys and wire formats.
+
+At present, only detached and armored signatures are supported.
+
+1. Armored format
+
+The Armored SSH signatures consist of a header, a base64
+encoded blob, and a footer.
+
+The header is the string "-----BEGIN SSH SIGNATURE-----"
+followed by a newline. The footer is the string
+"-----END SSH SIGNATURE-----" immediately after a newline.
+
+The header MUST be present at the start of every signature.
+Files containing the signature MUST start with the header.
+Likewise, the footer MUST be present at the end of every
+signature.
+
+The base64 encoded blob SHOULD be broken up by newlines
+every 76 characters.
+
+Example:
+
+-----BEGIN SSH SIGNATURE-----
+U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgJKxoLBJBivUPNTUJUSslQTt2hD
+jozKvHarKeN8uYFqgAAAADZm9vAAAAAAAAAFMAAAALc3NoLWVkMjU1MTkAAABAKNC4IEbt
+Tq0Fb56xhtuE1/lK9H9RZJfON4o6hE9R4ZGFX98gy0+fFJ/1d2/RxnZky0Y7GojwrZkrHT
+FgCqVWAQ==
+-----END SSH SIGNATURE-----
+
+2. Blob format
+
+#define MAGIC_PREAMBLE "SSHSIG"
+#define SIG_VERSION 0x01
+
+ byte[6] MAGIC_PREAMBLE
+ uint32 SIG_VERSION
+ string publickey
+ string namespace
+ string reserved
+ string hash_algorithm
+ string signature
+
+The publickey field MUST contain the serialisation of the
+public key used to make the signature using the usual SSH
+encoding rules, i.e RFC4253, RFC5656,
+draft-ietf-curdle-ssh-ed25519-ed448, etc.
+
+Verifiers MUST reject signatures with versions greater than those
+they support.
+
+The purpose of the namespace value is to specify a unambiguous
+interpretation domain for the signature, e.g. file signing.
+This prevents cross-protocol attacks caused by signatures
+intended for one intended domain being accepted in another.
+The namespace value MUST NOT be the empty string.
+
+The reserved value is present to encode future information
+(e.g. tags) into the signature. Implementations should ignore
+the reserved field if it is not empty.
+
+Data to be signed is first hashed with the specified hash_algorithm.
+This is done to limit the amount of data presented to the signature
+operation, which may be of concern if the signing key is held in limited
+or slow hardware or on a remote ssh-agent. The supported hash algorithms
+are "sha256" and "sha512".
+
+The signature itself is made using the SSH signature algorithm and
+encoding rules for the chosen key type. For RSA signatures, the
+signature algorithm must be "rsa-sha2-512" or "rsa-sha2-256" (i.e.
+not the legacy RSA-SHA1 "ssh-rsa").
+
+This blob is encoded as a string using the RFC4243 encoding
+rules and base64 encoded to form the middle part of the
+armored signature.
+
+
+3. Signed Data, of which the signature goes into the blob above
+
+#define MAGIC_PREAMBLE "SSHSIG"
+
+ byte[6] MAGIC_PREAMBLE
+ string namespace
+ string reserved
+ string hash_algorithm
+ string H(message)
+
+The preamble is the six-byte sequence "SSHSIG". It is included to
+ensure that manual signatures can never be confused with any message
+signed during SSH user or host authentication.
+
+The reserved value is present to encode future information
+(e.g. tags) into the signature. Implementations should ignore
+the reserved field if it is not empty.
+
+The data is concatenated and passed to the SSH signing
+function.
+
diff -r 0784089e00fd -r 8008c462b9fa crypto/external/bsd/openssh/dist/auth-options.c
--- a/crypto/external/bsd/openssh/dist/auth-options.c Sat Apr 20 17:13:53 2019 +0000
+++ b/crypto/external/bsd/openssh/dist/auth-options.c Sat Oct 12 15:13:53 2019 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.c,v 1.84 2018/10/03 06:38:35 djm Exp $ */
+/* $OpenBSD: auth-options.c,v 1.89 2019/09/13 04:36:43 dtucker Exp $ */
/*
* Copyright (c) 2018 Damien Miller <djm%mindrot.org@localhost>
*
@@ -18,6 +18,7 @@
#include <sys/types.h>
#include <sys/queue.h>
+#include <stdlib.h>
#include <netdb.h>
#include <pwd.h>
#include <string.h>
@@ -36,75 +37,6 @@
#include "ssh2.h"
#include "auth-options.h"
-/*
- * Match flag 'opt' in *optsp, and if allow_negate is set then also match
- * 'no-opt'. Returns -1 if option not matched, 1 if option matches or 0
- * if negated option matches.
- * If the option or negated option matches, then *optsp is updated to
- * point to the first character after the option.
- */
-static int
-opt_flag(const char *opt, int allow_negate, const char **optsp)
-{
- size_t opt_len = strlen(opt);
- const char *opts = *optsp;
- int negate = 0;
-
- if (allow_negate && strncasecmp(opts, "no-", 3) == 0) {
- opts += 3;
- negate = 1;
- }
- if (strncasecmp(opts, opt, opt_len) == 0) {
- *optsp = opts + opt_len;
- return negate ? 0 : 1;
- }
- return -1;
-}
-
-static char *
-opt_dequote(const char **sp, const char **errstrp)
-{
- const char *s = *sp;
- char *ret;
- size_t i;
-
- *errstrp = NULL;
- if (*s != '"') {
- *errstrp = "missing start quote";
- return NULL;
- }
- s++;
- if ((ret = malloc(strlen((s)) + 1)) == NULL) {
- *errstrp = "memory allocation failed";
- return NULL;
- }
- for (i = 0; *s != '\0' && *s != '"';) {
- if (s[0] == '\\' && s[1] == '"')
- s++;
- ret[i++] = *s++;
- }
- if (*s == '\0') {
- *errstrp = "missing end quote";
- free(ret);
- return NULL;
- }
- ret[i] = '\0';
- s++;
- *sp = s;
- return ret;
-}
-
-static int
-opt_match(const char **opts, const char *term)
-{
- if (strncasecmp((*opts), term, strlen(term)) == 0 &&
- (*opts)[strlen(term)] == '=') {
- *opts += strlen(term) + 1;
- return 1;
- }
- return 0;
-}
-
static int
dup_strings(char ***dstp, size_t *ndstp, char **src, size_t nsrc)
{
@@ -317,7 +249,7 @@
size_t npermits = *npermitsp;
const char *errstr = "unknown error";
- if (npermits > INT_MAX) {
+ if (npermits > SSH_AUTHOPT_PERMIT_MAX) {
*errstrp = "too many permission directives";
return -1;
}
@@ -329,7 +261,8 @@
* Allow a bare port number in permitlisten to indicate a
* listen_host wildcard.
*/
- if (asprintf(&tmp, "*:%s", opt) < 0) {
+ if (asprintf(&tmp, "*:%s", opt) == -1) {
+ free(opt);
*errstrp = "memory allocation failed";
return -1;
}
diff -r 0784089e00fd -r 8008c462b9fa crypto/external/bsd/openssh/dist/auth-options.h
--- a/crypto/external/bsd/openssh/dist/auth-options.h Sat Apr 20 17:13:53 2019 +0000
+++ b/crypto/external/bsd/openssh/dist/auth-options.h Sat Oct 12 15:13:53 2019 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.h,v 1.27 2018/06/06 18:23:32 djm Exp $ */
+/* $OpenBSD: auth-options.h,v 1.28 2019/07/09 04:15:00 djm Exp $ */
/*
* Copyright (c) 2018 Damien Miller <djm%mindrot.org@localhost>
@@ -22,6 +22,9 @@
struct passwd;
struct sshkey;
+/* Maximum number of permitopen/permitlisten directives to accept */
+#define SSH_AUTHOPT_PERMIT_MAX 4096
+
/*
* sshauthopt represents key options parsed from authorized_keys or
* from certificate extensions/options.
diff -r 0784089e00fd -r 8008c462b9fa crypto/external/bsd/openssh/dist/auth-rhosts.c
--- a/crypto/external/bsd/openssh/dist/auth-rhosts.c Sat Apr 20 17:13:53 2019 +0000
+++ b/crypto/external/bsd/openssh/dist/auth-rhosts.c Sat Oct 12 15:13:53 2019 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rhosts.c,v 1.49 2018/07/09 21:35:50 markus Exp $ */
+/* $OpenBSD: auth-rhosts.c,v 1.51 2019/10/02 00:42:30 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
* Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
@@ -34,7 +34,6 @@
#include "sshkey.h"
#include "servconf.h"
#include "canohost.h"
-#include "sshkey.h"
#include "hostfile.h"
#include "auth.h"
@@ -218,8 +217,8 @@
* are no system-wide files.
*/
if (!rhosts_files[rhosts_file_index] &&
- stat(_PATH_RHOSTS_EQUIV, &st) < 0 &&
- stat(_PATH_SSH_HOSTS_EQUIV, &st) < 0) {
+ stat(_PATH_RHOSTS_EQUIV, &st) == -1 &&
+ stat(_PATH_SSH_HOSTS_EQUIV, &st) == -1) {
debug3("%s: no hosts access files exist", __func__);
return 0;
}
@@ -249,7 +248,7 @@
* Check that the home directory is owned by root or the user, and is
* not group or world writable.
*/
- if (stat(pw->pw_dir, &st) < 0) {
+ if (stat(pw->pw_dir, &st) == -1) {
logit("Rhosts authentication refused for %.100s: "
"no home directory %.200s", pw->pw_name, pw->pw_dir);
auth_debug_add("Rhosts authentication refused for %.100s: "
@@ -274,7 +273,7 @@
/* Check users .rhosts or .shosts. */
snprintf(buf, sizeof buf, "%.500s/%.100s",
pw->pw_dir, rhosts_files[rhosts_file_index]);
- if (stat(buf, &st) < 0)
+ if (stat(buf, &st) == -1)
continue;
/*
diff -r 0784089e00fd -r 8008c462b9fa crypto/external/bsd/openssh/dist/auth.c
--- a/crypto/external/bsd/openssh/dist/auth.c Sat Apr 20 17:13:53 2019 +0000
+++ b/crypto/external/bsd/openssh/dist/auth.c Sat Oct 12 15:13:53 2019 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.138 2019/01/19 21:41:18 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.141 2019/10/02 00:42:30 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -28,6 +28,7 @@
#include <sys/socket.h>
#include <sys/wait.h>
+#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <login_cap.h>
@@ -60,7 +61,6 @@
#endif
#include "authfile.h"
Home |
Main Index |
Thread Index |
Old Index