Skip to content

Commit 54ef290

Browse files
committed
Merge changes between OpenSSH-10.0 and 10.2
1 parent 471087b commit 54ef290

127 files changed

Lines changed: 4022 additions & 7490 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crypto/external/bsd/openssh/bin/ssh-agent/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# $NetBSD: Makefile,v 1.7 2023/06/03 09:09:02 lukem Exp $
1+
# $NetBSD: Makefile,v 1.8 2025/10/11 15:45:06 christos Exp $
22

33
BINDIR=/usr/bin
44

55
PROG= ssh-agent
6-
SRCS= ssh-agent.c ssh-pkcs11-client.c
6+
SRCS= misc-agent.c ssh-agent.c ssh-pkcs11-client.c
77

88
COPTS.ssh-agent.c+= ${CC_WNO_FORMAT_TRUNCATION}
99
COPTS.ssh-pkcs11-client.c+= -Wno-error=deprecated-declarations

crypto/external/bsd/openssh/dist/PROTOCOL

Lines changed: 27 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,11 @@ The method is documented in:
3333

3434
http://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt
3535

36-
1.3. transport: New public key algorithms "ssh-rsa-cert-v01@openssh.com",
37-
"ssh-dsa-cert-v01@openssh.com",
38-
"ecdsa-sha2-nistp256-cert-v01@openssh.com",
39-
"ecdsa-sha2-nistp384-cert-v01@openssh.com" and
40-
"ecdsa-sha2-nistp521-cert-v01@openssh.com"
36+
1.3. transport: Certificate key algorithms
4137

4238
OpenSSH introduces new public key algorithms to support certificate
4339
authentication for users and host keys. These methods are documented
44-
in the file PROTOCOL.certkeys
40+
in at https://datatracker.ietf.org/doc/draft-miller-ssh-cert/
4541

4642
1.4. transport: Elliptic Curve cryptography
4743

@@ -82,29 +78,20 @@ contains:
8278
1.6 transport: AES-GCM
8379

8480
OpenSSH supports the AES-GCM algorithm as specified in RFC 5647.
85-
Because of problems with the specification of the key exchange
86-
the behaviour of OpenSSH differs from the RFC as follows:
81+
Because of problems with the design of the algorithm negotiation in this
82+
RFC, OpenSSH (and other SSH implementations) use different rules as
83+
described in:
8784

88-
AES-GCM is only negotiated as the cipher algorithms
89-
"aes128-gcm@openssh.com" or "aes256-gcm@openssh.com" and never as
90-
an MAC algorithm. Additionally, if AES-GCM is selected as the cipher
91-
the exchanged MAC algorithms are ignored and there doesn't have to be
92-
a matching MAC.
85+
https://datatracker.ietf.org/doc/draft-miller-sshm-aes-gcm/
9386

9487
1.7 transport: chacha20-poly1305@openssh.com authenticated encryption
9588

9689
OpenSSH supports authenticated encryption using ChaCha20 and Poly1305
97-
as described in PROTOCOL.chacha20poly1305.
90+
as described in:
9891

99-
1.8 transport: curve25519-sha256@libssh.org key exchange algorithm
92+
https://datatracker.ietf.org/doc/draft-ietf-sshm-chacha20-poly1305/
10093

101-
OpenSSH supports the use of ECDH in Curve25519 for key exchange as
102-
described at:
103-
http://git.libssh.org/users/aris/libssh.git/plain/doc/curve25519-sha256@libssh.org.txt?h=curve25519
104-
105-
This is identical to curve25519-sha256 as later published in RFC8731.
106-
107-
1.9 transport: ping facility
94+
1.8 transport: ping facility
10895

10996
OpenSSH implements a transport level ping message SSH2_MSG_PING
11097
and a corresponding SSH2_MSG_PONG reply.
@@ -137,34 +124,16 @@ than as a named global or channel request to allow pings with very
137124
short packet lengths, which would not be possible with other
138125
approaches.
139126

140-
1.10 transport: strict key exchange extension
141-
142-
OpenSSH supports a number of transport-layer hardening measures under
143-
a "strict KEX" feature. This feature is signalled similarly to the
144-
RFC8308 ext-info feature: by including a additional algorithm in the
145-
initial SSH2_MSG_KEXINIT kex_algorithms field. The client may append
146-
"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server
147-
may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms
148-
are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored
149-
if they are present in subsequent SSH2_MSG_KEXINIT packets.
150-
151-
When an endpoint that supports this extension observes this algorithm
152-
name in a peer's KEXINIT packet, it MUST make the following changes to
153-
the protocol:
154-
155-
a) During initial KEX, terminate the connection if out-of-sequence
156-
packet or any message that is not strictly required by KEX is
157-
received. This includes terminating the connection if the first
158-
packet received is not SSH2_MSG_KEXINIT. Unexpected packets for
159-
the purpose of strict KEX include messages that are otherwise
160-
valid at any time during the connection such as SSH2_MSG_DEBUG,
161-
SSH2_MSG_IGNORE or SSH2_MSG_UNIMPLEMENTED.
162-
b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the
163-
packet sequence number to zero. This behaviour persists for the
164-
duration of the connection (i.e. not just the first
165-
SSH2_MSG_NEWKEYS).
166-
167-
1.11 transport: SSH2_MSG_EXT_INFO during user authentication
127+
1.9 transport: strict key exchange extension
128+
129+
OpenSSH supports a number of transport-layer hardening measures
130+
designed to thwart the so-called "Terrapin" attack against the
131+
early SSH protocol. These are collectively referred to as
132+
"strict KEX" and documented in an Internet-Draft:
133+
134+
https://datatracker.ietf.org/doc/draft-miller-sshm-strict-kex/
135+
136+
1.10 transport: SSH2_MSG_EXT_INFO during user authentication
168137

169138
This protocol extension allows the SSH2_MSG_EXT_INFO to be sent
170139
during user authentication. RFC8308 does allow a second
@@ -369,52 +338,9 @@ and "hostkeys-prove-00@openssh.com"
369338

370339
OpenSSH supports a protocol extension allowing a server to inform
371340
a client of all its protocol v.2 host keys after user-authentication
372-
has completed.
373-
374-
byte SSH_MSG_GLOBAL_REQUEST
375-
string "hostkeys-00@openssh.com"
376-
char 0 /* want-reply */
377-
string[] hostkeys
378-
379-
Upon receiving this message, a client should check which of the
380-
supplied host keys are present in known_hosts.
381-
382-
Note that the server may send key types that the client does not
383-
support. The client should disregard such keys if they are received.
384-
385-
If the client identifies any keys that are not present for the host,
386-
it should send a "hostkeys-prove@openssh.com" message to request the
387-
server prove ownership of the private half of the key.
388-
389-
byte SSH_MSG_GLOBAL_REQUEST
390-
string "hostkeys-prove-00@openssh.com"
391-
char 1 /* want-reply */
392-
string[] hostkeys
393-
394-
When a server receives this message, it should generate a signature
395-
using each requested key over the following:
396-
397-
string "hostkeys-prove-00@openssh.com"
398-
string session identifier
399-
string hostkey
400-
401-
These signatures should be included in the reply, in the order matching
402-
the hostkeys in the request:
403-
404-
byte SSH_MSG_REQUEST_SUCCESS
405-
string[] signatures
406-
407-
When the client receives this reply (and not a failure), it should
408-
validate the signatures and may update its known_hosts file, adding keys
409-
that it has not seen before and deleting keys for the server host that
410-
are no longer offered.
341+
has completed. This is documented in an Internet-Draft
411342

412-
These extensions let a client learn key types that it had not previously
413-
encountered, thereby allowing it to potentially upgrade from weaker
414-
key algorithms to better ones. It also supports graceful key rotation:
415-
a server may offer multiple keys of the same type for a period (to
416-
give clients an opportunity to learn them using this extension) before
417-
removing the deprecated key from those offered.
343+
https://datatracker.ietf.org/doc/draft-miller-sshm-hostkey-update/
418344

419345
2.6. connection: SIGINFO support for "signal" channel request
420346

@@ -765,15 +691,15 @@ authorized_keys files, are formatted as a single line of text consisting
765691
of the public key algorithm name followed by a base64-encoded key blob.
766692
The public key blob (before base64 encoding) is the same format used for
767693
the encoding of public keys sent on the wire: as described in RFC4253
768-
section 6.6 for RSA and DSA keys, RFC5656 section 3.1 for ECDSA keys
769-
and the "New public key formats" section of PROTOCOL.certkeys for the
770-
OpenSSH certificate formats.
694+
section 6.6 for RSA keys, RFC5656 section 3.1 for ECDSA keys and
695+
https://datatracker.ietf.org/doc/draft-miller-ssh-cert/
696+
for the OpenSSH certificate formats.
771697

772698
5.2 Private key format
773699

774700
OpenSSH private keys, as generated by ssh-keygen(1) use the format
775701
described in PROTOCOL.key by default. As a legacy option, PEM format
776-
(RFC7468) private keys are also supported for RSA, DSA and ECDSA keys
702+
(RFC7468) private keys are also supported for RSA and ECDSA keys
777703
and were the default format before OpenSSH 7.8.
778704

779705
5.3 KRL format
@@ -792,5 +718,5 @@ master instance and later clients.
792718
OpenSSH extends the usual agent protocol. These changes are documented
793719
in the PROTOCOL.agent file.
794720

795-
$OpenBSD: PROTOCOL,v 1.55 2024/01/08 05:05:15 djm Exp $
796-
$NetBSD: PROTOCOL,v 1.24 2024/06/25 16:36:54 christos Exp $
721+
$OpenBSD: PROTOCOL,v 1.59 2025/08/06 11:22:53 dtucker Exp $
722+
$NetBSD: PROTOCOL,v 1.25 2025/10/11 15:45:06 christos Exp $

crypto/external/bsd/openssh/dist/PROTOCOL.agent

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$NetBSD: PROTOCOL.agent,v 1.18 2025/04/09 15:49:31 christos Exp $
1+
$NetBSD: PROTOCOL.agent,v 1.19 2025/10/11 15:45:06 christos Exp $
22
The SSH agent protocol is described in
33
https://datatracker.ietf.org/doc/draft-ietf-sshm-ssh-agent/
44

@@ -74,17 +74,6 @@ identities and, in particular, signature requests will check the key
7474
constraints against the session-bind@openssh.com bindings recorded for
7575
the agent connection over which they were received.
7676

77-
3. SSH_AGENT_CONSTRAIN_MAXSIGN key constraint
78-
79-
This key constraint allows communication to an agent of the maximum
80-
number of signatures that may be made with an XMSS key. The format of
81-
the constraint is:
82-
83-
byte SSH_AGENT_CONSTRAIN_MAXSIGN (0x03)
84-
uint32 max_signatures
85-
86-
This option is only valid for XMSS keys.
87-
8877
3. associated-certs-v00@openssh.com key constraint extension
8978

9079
The key constraint extension allows certificates to be associated
@@ -116,4 +105,4 @@ A SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED will return SSH_AGENT_SUCCESS
116105
if any key (plain private or certificate) was successfully loaded, or
117106
SSH_AGENT_FAILURE if no key was loaded.
118107

119-
$OpenBSD: PROTOCOL.agent,v 1.24 2024/11/27 13:27:34 djm Exp $
108+
$OpenBSD: PROTOCOL.agent,v 1.25 2025/08/29 03:50:38 djm Exp $

0 commit comments

Comments
 (0)