Skip to content

Commit

Permalink
Merge branch 'master' into awslc_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
smittals2 authored Feb 6, 2025
2 parents 2f81f9d + 85b3d68 commit e56905b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
4 changes: 2 additions & 2 deletions auth2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2.c,v 1.169 2024/05/17 00:30:23 djm Exp $ */
/* $OpenBSD: auth2.c,v 1.170 2025/01/17 00:09:41 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
Expand Down Expand Up @@ -238,7 +238,7 @@ user_specific_delay(const char *user)
/* 0-4.2 ms of delay */
delay = (double)PEEK_U32(hash) / 1000 / 1000 / 1000 / 1000;
freezero(hash, len);
debug3_f("user specific delay %0.3lfms", delay/1000);
debug3_f("user specific delay %0.3lfms", delay*1000);
return MIN_FAIL_DELAY_SECONDS + delay;
}

Expand Down
30 changes: 16 additions & 14 deletions servconf.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: servconf.c,v 1.419 2024/09/25 01:24:04 djm Exp $ */
/* $OpenBSD: servconf.c,v 1.421 2025/01/15 22:23:13 dtucker Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
* All rights reserved
Expand Down Expand Up @@ -2808,23 +2808,25 @@ parse_server_match_config(ServerOptions *options,
copy_set_server_options(options, &mo, 0);
}

int parse_server_match_testspec(struct connection_info *ci, char *spec)
int
parse_server_match_testspec(struct connection_info *ci, char *spec)
{
char *p;
const char *val;

while ((p = strsep(&spec, ",")) && *p != '\0') {
if (strncmp(p, "addr=", 5) == 0) {
ci->address = xstrdup(p + 5);
} else if (strncmp(p, "host=", 5) == 0) {
ci->host = xstrdup(p + 5);
} else if (strncmp(p, "user=", 5) == 0) {
ci->user = xstrdup(p + 5);
} else if (strncmp(p, "laddr=", 6) == 0) {
ci->laddress = xstrdup(p + 6);
} else if (strncmp(p, "rdomain=", 8) == 0) {
ci->rdomain = xstrdup(p + 8);
} else if (strncmp(p, "lport=", 6) == 0) {
ci->lport = a2port(p + 6);
if ((val = strprefix(p, "addr=", 0)) != NULL) {
ci->address = xstrdup(val);
} else if ((val = strprefix(p, "host=", 0)) != NULL) {
ci->host = xstrdup(val);
} else if ((val = strprefix(p, "user=", 0)) != NULL) {
ci->user = xstrdup(val);
} else if ((val = strprefix(p, "laddr=", 0)) != NULL) {
ci->laddress = xstrdup(val);
} else if ((val = strprefix(p, "rdomain=", 0)) != NULL) {
ci->rdomain = xstrdup(val);
} else if ((val = strprefix(p, "lport=", 0)) != NULL) {
ci->lport = a2port(val);
if (ci->lport == -1) {
fprintf(stderr, "Invalid port '%s' in test mode"
" specification %s\n", p+6, p);
Expand Down
9 changes: 6 additions & 3 deletions sshd-auth.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: sshd-auth.c,v 1.2 2024/12/03 22:30:03 jsg Exp $ */
/* $OpenBSD: sshd-auth.c,v 1.3 2025/01/16 06:37:10 dtucker Exp $ */
/*
* SSH2 implementation:
* Privilege Separation:
Expand Down Expand Up @@ -636,8 +636,6 @@ main(int ac, char **av)
exit(1);
}

debug("sshd version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);

/* Connection passed by stdin/out */
if (inetd_flag) {
/*
Expand Down Expand Up @@ -675,6 +673,11 @@ main(int ac, char **av)
fill_default_server_options(&options);
options.timing_secret = timing_secret; /* XXX eliminate from unpriv */

/* Reinit logging in case config set Level, Facility or Verbose. */
log_init(__progname, options.log_level, options.log_facility, 1);

debug("sshd-auth version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);

/* Store privilege separation user for later use if required. */
privsep_chroot = (getuid() == 0 || geteuid() == 0);
if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
Expand Down
12 changes: 7 additions & 5 deletions sshd-session.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: sshd-session.c,v 1.9 2024/09/09 02:39:57 djm Exp $ */
/* $OpenBSD: sshd-session.c,v 1.11 2025/01/16 06:37:10 dtucker Exp $ */
/*
* SSH2 implementation:
* Privilege Separation:
Expand Down Expand Up @@ -987,8 +987,6 @@ main(int ac, char **av)
exit(1);
}

debug("sshd version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);

if (!rexeced_flag)
fatal("sshd-session should not be executed directly");

Expand Down Expand Up @@ -1028,8 +1026,6 @@ main(int ac, char **av)
SYSLOG_FACILITY_AUTH : options.log_facility,
log_stderr || !inetd_flag || debug_flag);

debug("sshd version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);

/* Fetch our configuration */
if ((cfg = sshbuf_new()) == NULL)
fatal("sshbuf_new config buf failed");
Expand All @@ -1043,6 +1039,12 @@ main(int ac, char **av)
fill_default_server_options(&options);
options.timing_secret = timing_secret;

/* Reinit logging in case config set Level, Facility or Verbose. */
log_init(__progname, options.log_level, options.log_facility,
log_stderr || !inetd_flag || debug_flag);

debug("sshd-session version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);

/* Store privilege separation user for later use if required. */
privsep_chroot = (getuid() == 0 || geteuid() == 0);
if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
Expand Down

0 comments on commit e56905b

Please sign in to comment.