Skip to content

Commit c868a3b

Browse files
authored
Merge pull request #56 from rapier1/release_candidates
Merge 18.2.0-RC1 into Master
2 parents 5c1ad8d + 70844a7 commit c868a3b

Some content is hidden

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

58 files changed

+1483
-1101
lines changed

.github/ci-status.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ master :
66
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh)
77
[![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable)
88

9+
9.4 :
10+
[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_4)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_4)
11+
[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_4)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_4)
12+
913
9.3 :
1014
[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_3)
1115
[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_3)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_3)

.github/configs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ case "$config" in
3030
default|sol64)
3131
;;
3232
c89)
33+
# If we don't have LLONG_MAX, configure will figure out that it can
34+
# get it by setting -std=gnu99, at which point we won't be testing
35+
# C89 any more. To avoid this, feed it in via CFLAGS.
36+
llong_max=`gcc -E -dM - </dev/null | \
37+
awk '$2=="__LONG_LONG_MAX__"{print $3}'`
38+
CPPFLAGS="-DLLONG_MAX=${llong_max}"
39+
3340
CC="gcc"
3441
CFLAGS="-Wall -std=c89 -pedantic -Werror=vla"
3542
CONFIGFLAGS="--without-zlib"
@@ -213,6 +220,10 @@ case "$config" in
213220
;;
214221
esac
215222
;;
223+
zlib-develop)
224+
INSTALL_ZLIB=develop
225+
CONFIGFLAGS="--with-zlib=/opt/zlib --with-rpath=-Wl,-rpath,"
226+
;;
216227
*)
217228
echo "Unknown configuration $config"
218229
exit 1

.github/setup_ci.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ for TARGET in $TARGETS; do
135135
valgrind*)
136136
PACKAGES="$PACKAGES valgrind"
137137
;;
138+
zlib-*)
139+
;;
138140
*) echo "Invalid option '${TARGET}'"
139141
exit 1
140142
;;
@@ -224,3 +226,9 @@ if [ ! -z "${INSTALL_BORINGSSL}" ]; then
224226
cp ${HOME}/boringssl/build/crypto/libcrypto.a /opt/boringssl/lib &&
225227
cp -r ${HOME}/boringssl/include /opt/boringssl)
226228
fi
229+
230+
if [ ! -z "${INSTALL_ZLIB}" ]; then
231+
(cd ${HOME} && git clone https://github.com/madler/zlib.git &&
232+
cd ${HOME}/zlib && ./configure && make &&
233+
sudo make install prefix=/opt/zlib)
234+
fi

.github/workflows/c-cpp.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- { target: ubuntu-20.04, config: valgrind-2 }
2929
- { target: ubuntu-20.04, config: valgrind-3 }
3030
- { target: ubuntu-20.04, config: valgrind-4 }
31-
- { target: ubuntu-20.04, config: valgrind-5 }
31+
# - { target: ubuntu-20.04, config: valgrind-5 }
3232
- { target: ubuntu-20.04, config: valgrind-6 }
3333
- { target: ubuntu-20.04, config: valgrind-7 }
3434
- { target: ubuntu-20.04, config: c89 }
@@ -38,10 +38,6 @@ jobs:
3838
- { target: ubuntu-20.04, config: clang-10 }
3939
- { target: ubuntu-20.04, config: clang-11 }
4040
- { target: ubuntu-20.04, config: clang-12-Werror }
41-
- { target: ubuntu-20.04, config: clang-sanitize-address }
42-
- { target: ubuntu-20.04, config: clang-sanitize-undefined }
43-
- { target: ubuntu-20.04, config: gcc-sanitize-address }
44-
- { target: ubuntu-20.04, config: gcc-sanitize-undefined }
4541
- { target: ubuntu-20.04, config: gcc-7 }
4642
- { target: ubuntu-20.04, config: gcc-8 }
4743
- { target: ubuntu-20.04, config: gcc-10 }
@@ -68,6 +64,7 @@ jobs:
6864
- { target: ubuntu-latest, config: openssl-3.1.0 }
6965
- { target: ubuntu-latest, config: openssl-1.1.1_stable }
7066
- { target: ubuntu-latest, config: openssl-3.0 } # stable branch
67+
- { target: ubuntu-latest, config: zlib-develop }
7168
- { target: ubuntu-22.04, config: pam }
7269
- { target: ubuntu-22.04, config: krb5 }
7370
- { target: ubuntu-22.04, config: heimdal }
@@ -76,6 +73,10 @@ jobs:
7673
- { target: ubuntu-22.04, config: selinux }
7774
- { target: ubuntu-22.04, config: kitchensink }
7875
- { target: ubuntu-22.04, config: without-openssl }
76+
- { target: ubuntu-22.04, config: clang-sanitize-address }
77+
- { target: ubuntu-22.04, config: clang-sanitize-undefined }
78+
- { target: ubuntu-22.04, config: gcc-sanitize-address }
79+
- { target: ubuntu-22.04, config: gcc-sanitize-undefined }
7980
# we know pam doesn't work because we can't install a new pam file
8081
# for hpnssh via the CI test methods
8182
# - { target: macos-11, config: pam }

.github/workflows/selfhosted.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- obsd67
4141
- obsd69
4242
- obsd70
43+
- obsd72
44+
- obsd73
4345
- obsdsnap
4446
- obsdsnap-i386
4547
- openindiana
@@ -76,6 +78,7 @@ jobs:
7678
- { target: ARM64, config: default, host: ARM64 }
7779
- { target: ARM64, config: pam, host: ARM64 }
7880
- { target: debian-riscv64, config: default, host: debian-riscv64 }
81+
- { target: obsd-arm64, config: default, host: obsd-arm64 }
7982
- { target: openwrt-mips, config: default, host: openwrt-mips }
8083
- { target: openwrt-mipsel, config: default, host: openwrt-mipsel }
8184
steps:

HPN-README

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,23 @@ metrics from multiplexed sessions will report on the activity of all sessions on
5151
This will likely result in less clear results and, as such, we suggest only gathering metrics
5252
from non-multiplexed session.
5353

54-
SCP with Resume functionality
55-
This feature allows SCP to resume failed transfers. In the event of a failed transfer
54+
HPNSCP with Resume functionality
55+
This feature allows hpnscp to resume failed transfers. In the event of a failed transfer
5656
issues the same scp command with the '-R' option. For example - if you issued:
57-
'scp myhugefile me@host:~'
57+
'hpnscp myhugefile me@host:~'
5858
and it dies halfway through the transfer issuing
59-
'scp -Z myhugefile me@host:~'
59+
'hpnscp -Z myhugefile me@host:~'
6060
will resume the transfer at the point where it left off.
6161

6262
This is implemented by having the source host send a hash (blake2b512) of the file to the
63-
target host. Teh target host then computes it's own hash of the target file. If the hashes match
63+
target host. The target host then computes it's own hash of the target file. If the hashes match
6464
then the file is skipped as this indicates a successful transfer. However, if the hashes do not
6565
match then the target sends the source its hash along with the size of the file. The source then
6666
computes the hash of the file *up to* the size of the target file. If those hashes match then
6767
the source only send the necessary bytes to complete the transfer. If the hashes do not match then
6868
the entire file is resent. If the target file is larger then the source file then the entire
6969
source file is sent and any existing target file is overwritten.
7070

71-
SCP however, will use the first scp in the user's path. This might not support the resume
72-
function and the attempt will fail. In those cases the user can explicitly define the path to the
73-
resume enabled scp with the '-z' option. For example:
74-
75-
'scp -Z -z /opt/hpnssh/usr/bin/scp myhugefile me@host:~'
7671

7772
MULTI-THREADED AES CIPHER:
7873
The AES cipher in CTR mode has been multithreaded (MTR-AES-CTR). This will allow ssh installations
@@ -124,63 +119,8 @@ more than 30%.
124119

125120
ex: scp -oNoneSwitch=yes -oNoneEnabled=yes -oNoneMacEnabled=yes file host:~
126121

127-
BUFFER SIZES:
128-
129-
If HPN is disabled the receive buffer size will be set to the
130-
OpenSSH default of 2MB (for OpenSSH versions before 4.7: 64KB).
131-
132-
If an HPN system connects to a nonHPN system the receive buffer will
133-
be set to the HPNBufferSize value. The default is 2MB but user adjustable.
134-
135-
If an HPN to HPN connection is established a number of different things might
136-
happen based on the user options and conditions.
137-
138-
Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set
139-
HPN Buffer Size = up to 64MB
140-
This is the default state. The HPN buffer size will grow to a maximum of 64MB
141-
as the TCP receive buffer grows. The maximum HPN Buffer size of 64MB is
142-
geared towards 10GigE transcontinental connections.
143-
144-
Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set
145-
HPN Buffer Size = TCP receive buffer value.
146-
Users on non-autotuning systems should disable TCPRcvBufPoll in the
147-
ssh_config and sshd_config
148-
149-
Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set
150-
HPN Buffer Size = minimum of TCP receive buffer and HPNBufferSize.
151-
This would be the system defined TCP receive buffer (RWIN).
152-
153-
Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf SET
154-
HPN Buffer Size = minimum of TCPRcvBuf and HPNBufferSize.
155-
Generally there is no need to set both.
156-
157-
Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set
158-
HPN Buffer Size = grows to HPNBufferSize
159-
The buffer will grow up to the maximum size specified here.
160-
161-
Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf SET
162-
HPN Buffer Size = minimum of TCPRcvBuf and HPNBufferSize.
163-
Generally there is no need to set both of these, especially on autotuning
164-
systems. However, if the users wishes to override the autotuning this would be
165-
one way to do it.
166-
167-
Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf SET
168-
HPN Buffer Size = TCPRcvBuf.
169-
This will override autotuning and set the TCP recieve buffer to the user defined
170-
value.
171-
172-
173122
HPN Specific Configuration options
174123

175-
TcpRcvBuf=[int]KB client
176-
Set the TCP socket receive buffer to n Kilobytes. It can be set up to the
177-
maximum socket size allowed by the system. This is useful in situations where
178-
the tcp receive window is set low but the maximum buffer size is set
179-
higher (as is typical). This works on a per TCP connection basis. You can also
180-
use this to artifically limit the transfer rate of the connection. In these
181-
cases the throughput will be no more than n/RTT. The minimum buffer size is 1KB.
182-
Default is the current system wide tcp receive buffer size.
183-
184124
TcpRcvBufPoll=[yes/no] client/server
185125
Enable of disable the polling of the tcp receive buffer through the life
186126
of the connection. You would want to make sure that this option is enabled
@@ -214,21 +154,6 @@ HPNDisabled=[yes/no] client/server
214154
of the HPN code produces a net decrease in performance. In these cases it is
215155
helpful to disable the HPN functionality. By default HPNDisabled is set to no.
216156

217-
HPNBufferSize=[int]KB client/server
218-
This is the default buffer size the HPN functionality uses when interacting
219-
with nonHPN SSH installations. Conceptually this is similar to the TcpRcvBuf
220-
option as applied to the internal SSH flow control. This value can range from
221-
1KB to 64MB (1-65536). Use of oversized or undersized buffers can cause performance
222-
problems depending on the length of the network path. The default size of this buffer
223-
is 2MB.
224-
225-
DisableMTAES=[yes/no] client/server
226-
Switch the encryption cipher being used from the multithreaded MT-AES-CTR cipher
227-
back to the stock single-threaded AES-CTR cipher. Useful on modern processors with
228-
AES-NI instructions which make the stock single-threaded AES-CTR cipher faster than
229-
the multithreaded MT-AES-CTR cipher. Set to no by default.
230-
231-
232157
Credits: This patch was conceived, designed, and led by Chris Rapier ([email protected])
233158
The majority of the actual coding for versions up to HPN12v1 was performed
234159
by Michael Stevens ([email protected]). The MT-AES-CTR cipher was
@@ -240,3 +165,6 @@ Credits: This patch was conceived, designed, and led by Chris Rapier (rapier@psc
240165

241166
Sponsors: Thanks to Niklas Hambuchen for being the first sponsor of HPN-SSH
242167
via github's sponsor program!
168+
169+
170+
Edited: October 11, 2023

PROTOCOL

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,39 @@ http://git.libssh.org/users/aris/libssh.git/plain/doc/[email protected]
104104

105105
This is identical to curve25519-sha256 as later published in RFC8731.
106106

107+
1.9 transport: ping facility
108+
109+
OpenSSH implements a transport level ping message SSH2_MSG_PING
110+
and a corresponding SSH2_MSG_PONG reply.
111+
112+
#define SSH2_MSG_PING 192
113+
#define SSH2_MSG_PONG 193
114+
115+
The ping message is simply:
116+
117+
byte SSH_MSG_PING
118+
string data
119+
120+
The reply copies the data (which may be the empty string) from the
121+
ping:
122+
123+
byte SSH_MSG_PONG
124+
string data
125+
126+
Replies are sent in order. They are sent immediately except when rekeying
127+
is in progress, in which case they are queued until rekeying completes.
128+
129+
The server advertises support for these messages using the
130+
SSH2_MSG_EXT_INFO mechanism (RFC8308), with the following message:
131+
132+
133+
string "0" (version)
134+
135+
The ping/reply message is implemented at the transport layer rather
136+
than as a named global or channel request to allow pings with very
137+
short packet lengths, which would not be possible with other
138+
approaches.
139+
107140
2. Connection protocol changes
108141

109142
2.1. connection: Channel write close extension "[email protected]"
@@ -712,4 +745,4 @@ master instance and later clients.
712745
OpenSSH extends the usual agent protocol. These changes are documented
713746
in the PROTOCOL.agent file.
714747

715-
$OpenBSD: PROTOCOL,v 1.48 2022/11/07 01:53:01 dtucker Exp $
748+
$OpenBSD: PROTOCOL,v 1.49 2023/08/28 03:28:43 djm Exp $

PROTOCOL.agent

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The SSH agent protocol is described in
2-
https://tools.ietf.org/html/draft-miller-ssh-agent-04
2+
https://tools.ietf.org/html/draft-miller-ssh-agent
33

44
This file documents OpenSSH's extensions to the agent protocol.
55

@@ -81,4 +81,4 @@ the constraint is:
8181

8282
This option is only valid for XMSS keys.
8383

84-
$OpenBSD: PROTOCOL.agent,v 1.19 2023/04/12 08:53:54 jsg Exp $
84+
$OpenBSD: PROTOCOL.agent,v 1.20 2023/10/03 23:56:10 djm Exp $

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
See https://www.openssh.com/releasenotes.html#9.4p1 for the release
1+
See https://www.openssh.com/releasenotes.html#9.5p1 for the release
22
notes.
33

44
Please read https://www.openssh.com/report.html for bug reporting

auth2.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: auth2.c,v 1.166 2023/03/08 04:43:12 guenther Exp $ */
1+
/* $OpenBSD: auth2.c,v 1.167 2023/08/28 09:48:11 djm Exp $ */
22
/*
33
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
*
@@ -225,6 +225,7 @@ input_service_request(int type, u_int32_t seq, struct ssh *ssh)
225225
}
226226

227227
#define MIN_FAIL_DELAY_SECONDS 0.005
228+
#define MAX_FAIL_DELAY_SECONDS 5.0
228229
static double
229230
user_specific_delay(const char *user)
230231
{
@@ -250,6 +251,12 @@ ensure_minimum_time_since(double start, double seconds)
250251
struct timespec ts;
251252
double elapsed = monotime_double() - start, req = seconds, remain;
252253

254+
if (elapsed > MAX_FAIL_DELAY_SECONDS) {
255+
debug3_f("elapsed %0.3lfms exceeded the max delay "
256+
"requested %0.3lfms)", elapsed*1000, req*1000);
257+
return;
258+
}
259+
253260
/* if we've already passed the requested time, scale up */
254261
while ((remain = seconds - elapsed) < 0.0)
255262
seconds *= 2;
@@ -346,7 +353,7 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
346353
debug2("input_userauth_request: try method %s", method);
347354
authenticated = m->userauth(ssh, method);
348355
}
349-
if (!authctxt->authenticated)
356+
if (!authctxt->authenticated && strcmp(method, "none") != 0)
350357
ensure_minimum_time_since(tstart,
351358
user_specific_delay(authctxt->user));
352359
userauth_finish(ssh, authenticated, method, NULL);

0 commit comments

Comments
 (0)