Skip to content

Commit cac53c9

Browse files
committed
Port to 9.8
2 parents a054656 + cfe243c commit cac53c9

31 files changed

+1092
-195
lines changed

.depend

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

.skipped-commit-ids

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ ef9341d5a50f0d33e3a6fbe995e92964bc7ef2d3 Makefile relinking changes
3333
2fe8d707ae35ba23c7916adcb818bb5b66837ba0 ssh-agent relink kit
3434
866cfcc1955aef8f3fc32da0b70c353a1b859f2e ssh-agent relink changes
3535
8b3820adb4da4e139c4b3cffbcc0bde9f08bf0c6 sshd-session relink kit
36+
6d2ded4cd91d4d727c2b26e099b91ea935bed504 relink kit
37+
fb39324748824cb0387e9d67c41d1bef945c54ea Makefile change
38+
5f378c38ad8976d507786dc4db9283a879ec8cd0 Makefile change
39+
112aacedd3b61cc5c34b1fa6d9fb759214179172 Makefile change
3640

3741
Old upstream tree:
3842

auth.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: auth.h,v 1.107 2024/05/17 00:30:23 djm Exp $ */
1+
/* $OpenBSD: auth.h,v 1.108 2024/05/17 06:42:04 jsg Exp $ */
22

33
/*
44
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -155,8 +155,6 @@ void auth2_record_info(Authctxt *authctxt, const char *, ...)
155155
void auth2_update_session_info(Authctxt *, const char *, const char *);
156156

157157
#ifdef KRB5
158-
int auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *);
159-
int auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
160158
int auth_krb5_password(Authctxt *authctxt, const char *password);
161159
void krb5_cleanup_proc(Authctxt *authctxt);
162160
#endif /* KRB5 */
@@ -215,7 +213,6 @@ int sshd_hostkey_sign(struct ssh *, struct sshkey *, struct sshkey *,
215213
u_char **, size_t *, const u_char *, size_t, const char *);
216214

217215
/* Key / cert options linkage to auth layer */
218-
const struct sshauthopt *auth_options(struct ssh *);
219216
int auth_activate_options(struct ssh *, struct sshauthopt *);
220217
void auth_restrict_session(struct ssh *);
221218
void auth_log_authopts(const char *, const struct sshauthopt *, int);

auth2-methods.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "includes.h"
1818

1919
#include <sys/types.h>
20-
#include <sys/queue.h>
2120

2221
#include <stdlib.h>
2322
#include <string.h>
@@ -32,13 +31,13 @@
3231
extern ServerOptions options;
3332

3433
/*
35-
* Configuration of enabled authentication methods. Separate to the rest of
34+
* Configuration of enabled authentication methods. Separate from the rest of
3635
* auth2-*.c because we want to query it during server configuration validity
3736
* checking in the sshd listener process without pulling all the auth code in
3837
* too.
3938
*/
4039

41-
/* "none" is allowed only one time and it cleared by userauth_none() later */
40+
/* "none" is allowed only one time and it is cleared by userauth_none() later */
4241
int none_enabled = 1;
4342
struct authmethod_cfg methodcfg_none = {
4443
"none",
@@ -86,7 +85,7 @@ static struct authmethod_cfg *authmethod_cfgs[] = {
8685
};
8786

8887
/*
89-
* Check a comma-separated list of methods for validity. Is need_enable is
88+
* Check a comma-separated list of methods for validity. If need_enable is
9089
* non-zero, then also require that the methods are enabled.
9190
* Returns 0 on success or -1 if the methods list is invalid.
9291
*/

channels.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: channels.h,v 1.154 2023/12/18 14:47:20 djm Exp $ */
1+
/* $OpenBSD: channels.h,v 1.156 2024/05/23 23:47:16 jsg Exp $ */
22

33
/*
44
* Author: Tatu Ylonen <[email protected]>
@@ -85,7 +85,6 @@
8585
struct ssh;
8686
struct Channel;
8787
typedef struct Channel Channel;
88-
struct fwd_perm_list;
8988

9089
typedef void channel_open_fn(struct ssh *, int, int, void *);
9190
typedef void channel_callback_fn(struct ssh *, int, int, void *);
@@ -327,7 +326,6 @@ int channel_input_ieof(int, u_int32_t, struct ssh *);
327326
int channel_input_oclose(int, u_int32_t, struct ssh *);
328327
int channel_input_open_confirmation(int, u_int32_t, struct ssh *);
329328
int channel_input_open_failure(int, u_int32_t, struct ssh *);
330-
int channel_input_port_open(int, u_int32_t, struct ssh *);
331329
int channel_input_window_adjust(int, u_int32_t, struct ssh *);
332330
int channel_input_status_confirm(int, u_int32_t, struct ssh *);
333331

clientloop.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: clientloop.c,v 1.406 2024/05/09 09:46:47 djm Exp $ */
1+
/* $OpenBSD: clientloop.c,v 1.407 2024/05/17 06:42:04 jsg Exp $ */
22
/*
33
* Author: Tatu Ylonen <[email protected]>
44
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
@@ -198,8 +198,6 @@ TAILQ_HEAD(global_confirms, global_confirm);
198198
static struct global_confirms global_confirms =
199199
TAILQ_HEAD_INITIALIZER(global_confirms);
200200

201-
void ssh_process_session2_setup(int, int, int, struct sshbuf *);
202-
203201
void client_request_metrics(struct ssh *);
204202

205203
static void quit_message(const char *fmt, ...)

clientloop.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: clientloop.h,v 1.37 2020/04/03 02:40:32 djm Exp $ */
1+
/* $OpenBSD: clientloop.h,v 1.38 2024/05/17 06:42:04 jsg Exp $ */
22

33
/*
44
* Author: Tatu Ylonen <[email protected]>
@@ -43,7 +43,6 @@ struct ssh;
4343
int client_loop(struct ssh *, int, int, int);
4444
int client_x11_get_proto(struct ssh *, const char *, const char *,
4545
u_int, u_int, char **, char **);
46-
void client_global_request_reply_fwd(int, u_int32_t, void *);
4746
void client_session2_setup(struct ssh *, int, int, int,
4847
const char *, struct termios *, int, struct sshbuf *, char **);
4948
char *client_request_tun_fwd(struct ssh *, int, int, int,

hpnssh.1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3434
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
.\"
36-
.\" $OpenBSD: ssh.1,v 1.439 2024/03/14 06:23:14 job Exp $
37-
.Dd $Mdocdate: March 14 2024 $
36+
.\" $OpenBSD: ssh.1,v 1.440 2024/05/26 20:35:12 naddy Exp $
37+
.Dd $Mdocdate: May 26 2024 $
3838
.Dt HPNSSH 1
3939
.Os
4040
.Sh NAME
@@ -1660,8 +1660,6 @@ Systemwide configuration file.
16601660
The file format and configuration options are described in
16611661
.Xr hpnssh_config 5 .
16621662
.Pp
1663-
.It Pa /etc/hpnssh/ssh_host_key
1664-
.It Pa /etc/hpnssh/ssh_host_dsa_key
16651663
.It Pa /etc/hpnssh/ssh_host_ecdsa_key
16661664
.It Pa /etc/hpnssh/ssh_host_ed25519_key
16671665
.It Pa /etc/hpnssh/ssh_host_rsa_key

hpnsshd_config.5

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3434
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
.\"
36-
.\" $OpenBSD: sshd_config.5,v 1.355 2024/02/21 06:17:29 djm Exp $
37-
.Dd $Mdocdate: February 21 2024 $
36+
.\" $OpenBSD: sshd_config.5,v 1.359 2024/06/11 01:07:35 djm Exp $
37+
.Dd $Mdocdate: June 11 2024 $
3838
.Dt HPNSSHD_CONFIG 5
3939
.Os
4040
.Sh NAME
@@ -1589,6 +1589,75 @@ Values for IPv4 and optionally IPv6 may be specified, separated by a colon.
15891589
The default is
15901590
.Cm 32:128 ,
15911591
which means each address is considered individually.
1592+
.It Cm PerSourcePenalties
1593+
Controls penalties for various conditions that may represent attacks on
1594+
.Xr sshd 8 .
1595+
If a penalty is enforced against a client then its source address and any
1596+
others in the same network, as defined by
1597+
.Cm PerSourceNetBlockSize ,
1598+
will be refused connection for a period.
1599+
.Pp
1600+
A penalty doesn't affect concurrent connections in progress, but multiple
1601+
penalties from the same source from concurrent connections will accumulate
1602+
up to a maximum.
1603+
Conversely, penalties are not applied until a minimum threshold time has been
1604+
accumulated.
1605+
.Pp
1606+
Penalties are enabled by default with the default settings listed below
1607+
but may disabled using the
1608+
.Cm off
1609+
keyword.
1610+
The defaults may be overridden by specifying one or more of the keywords below,
1611+
separated by whitespace.
1612+
All keywords accept arguments, e.g.\&
1613+
.Qq crash:2m .
1614+
.Bl -tag -width Ds
1615+
.It Cm crash:duration
1616+
Specifies how long to refuse clients that cause a crash of
1617+
.Xr sshd 8 (default: 90s).
1618+
.It Cm authfail:duration
1619+
Specifies how long to refuse clients that disconnect after making one or more
1620+
unsuccessful authentication attempts (default: 5s).
1621+
.It Cm noauth:duration
1622+
Specifies how long to refuse clients that disconnect without attempting
1623+
authentication (default: 1s).
1624+
This timeout should be used cautiously otherwise it may penalise legitimate
1625+
scanning tools such as
1626+
.Xr ssh-keyscan 1 .
1627+
.It Cm grace-exceeded:duration
1628+
Specifies how long to refuse clients that fail to authenticate after
1629+
.Cm LoginGraceTime (default: 20s).
1630+
.It Cm max:duration
1631+
Specifies the maximum time a particular source address range will be refused
1632+
access for (default: 10m).
1633+
Repeated penalties will accumulate up to this maximum.
1634+
.It Cm min:duration
1635+
Specifies the minimum penalty that must accrue before enforcement begins
1636+
(default: 15s).
1637+
.It Cm max-sources:number
1638+
Specifies the maximum number of penalise client address ranges to track
1639+
(default: 65536).
1640+
.It Cm overflow:mode
1641+
Controls how the server behaves when
1642+
.Cm max-sources
1643+
is exceeded.
1644+
There are two operating modes:
1645+
.Cm deny-all ,
1646+
which denies all incoming connections other than those exempted via
1647+
.Cm PerSourcePenaltyExemptList
1648+
until a penalty expires, and
1649+
.Cm permissive ,
1650+
which allows new connections by removing existing penalties early
1651+
(default: permissive).
1652+
.El
1653+
.It Cm PerSourcePenaltyExemptList
1654+
Specifies a comma-separated list of addresses to exempt from penalties.
1655+
This list may contain wildcards and CIDR address/masklen ranges.
1656+
Note that the mask length provided must be consistent with the address -
1657+
it is an error to specify a mask length that is too long for the address
1658+
or one with bits set in this host portion of the address.
1659+
For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1660+
The default is not to exempt any addresses.
15921661
.It Cm PidFile
15931662
Specifies the file that contains the process ID of the
15941663
SSH daemon, or

misc.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: misc.c,v 1.194 2024/05/17 00:30:23 djm Exp $ */
1+
/* $OpenBSD: misc.c,v 1.196 2024/06/06 17:15:25 djm Exp $ */
22
/*
33
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
@@ -619,7 +619,7 @@ int
619619
convtime(const char *s)
620620
{
621621
int secs, total = 0, multiplier;
622-
char *p, *os, *np, c;
622+
char *p, *os, *np, c = 0;
623623
const char *errstr;
624624

625625
if (s == NULL || *s == '\0')
@@ -3098,3 +3098,19 @@ lib_contains_symbol(const char *path, const char *s)
30983098
return ret;
30993099
#endif /* HAVE_NLIST_H */
31003100
}
3101+
3102+
int
3103+
signal_is_crash(int sig)
3104+
{
3105+
switch (sig) {
3106+
case SIGSEGV:
3107+
case SIGBUS:
3108+
case SIGTRAP:
3109+
case SIGSYS:
3110+
case SIGFPE:
3111+
case SIGILL:
3112+
case SIGABRT:
3113+
return 1;
3114+
}
3115+
return 0;
3116+
}

0 commit comments

Comments
 (0)