Skip to content

Commit e29f1b8

Browse files
author
Lucas RAVAGNIER
committed
Merge branch 'upstream-8.3' into for-8.3/import_openssh-9.9p1-27.el10.alma.1.src.rpm
Signed-off-by: Lucas RAVAGNIER <lucas.ravagnier@vates.tech>
2 parents 7c859cf + e3561cb commit e29f1b8

74 files changed

Lines changed: 11319 additions & 6431 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.

SOURCES/gpgkey-736060BA.gpg

2.64 KB
Binary file not shown.

SOURCES/openssh-10.0-mlkem-nist-fips.patch

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

SOURCES/openssh-10.0-mlkem-nist.patch

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

SOURCES/openssh-6.6p1-allow-ip-opts.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ diff -up openssh/sshd.c.ip-opts openssh/sshd.c
3838
+ }
3939
+ } while (i < option_size);
4040
}
41-
return;
4241
#endif /* IP_OPTIONS */
42+
}

SOURCES/openssh-6.7p1-coverity.patch

Lines changed: 161 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,6 @@ diff -up openssh-8.5p1/loginrec.c.coverity openssh-8.5p1/loginrec.c
7373
strncpy(ut->ut_host, li->hostname,
7474
MIN_SIZEOF(ut->ut_host, li->hostname));
7575
# endif
76-
@@ -1690,6 +1692,7 @@ record_failed_login(struct ssh *ssh, con
77-
78-
memset(&ut, 0, sizeof(ut));
79-
/* strncpy because we don't necessarily want nul termination */
80-
+ /* coverity[buffer_size_warning : FALSE] */
81-
strncpy(ut.ut_user, username, sizeof(ut.ut_user));
82-
strlcpy(ut.ut_line, "ssh:notty", sizeof(ut.ut_line));
83-
84-
@@ -1699,6 +1702,7 @@ record_failed_login(struct ssh *ssh, con
85-
ut.ut_pid = getpid();
86-
87-
/* strncpy because we don't necessarily want nul termination */
88-
+ /* coverity[buffer_size_warning : FALSE] */
89-
strncpy(ut.ut_host, hostname, sizeof(ut.ut_host));
90-
91-
if (ssh_packet_connection_is_on_socket(ssh) &&
9276
diff -up openssh-8.5p1/misc.c.coverity openssh-8.5p1/misc.c
9377
--- openssh-8.5p1/misc.c.coverity 2021-03-24 12:03:33.745967902 +0100
9478
+++ openssh-8.5p1/misc.c 2021-03-24 13:31:47.037079617 +0100
@@ -175,6 +159,46 @@ diff -up openssh-8.7p1/openbsd-compat/bsd-pselect.c.coverity openssh-8.7p1/openb
175159
diff -up openssh-8.5p1/readconf.c.coverity openssh-8.5p1/readconf.c
176160
--- openssh-8.5p1/readconf.c.coverity 2021-03-24 12:03:33.778968131 +0100
177161
+++ openssh-8.5p1/readconf.c 2021-03-24 12:03:33.785968180 +0100
162+
@@ -749,12 +749,12 @@ match_cfg_line(Options *options, const c
163+
debug2("checking match for '%s' host %s originally %s",
164+
full_line, host, original_host);
165+
while ((attrib = argv_next(acp, avp)) != NULL) {
166+
- attrib = oattrib = xstrdup(attrib);
167+
/* Terminate on comment */
168+
if (*attrib == '#') {
169+
argv_consume(acp);
170+
break;
171+
}
172+
+ attrib = oattrib = xstrdup(attrib);
173+
arg = criteria = NULL;
174+
this_result = 1;
175+
if ((negate = (attrib[0] == '!')))
176+
@@ -793,7 +793,7 @@ match_cfg_line(Options *options, const c
177+
debug3("%.200s line %d: %smatched '%s'",
178+
filename, linenum,
179+
this_result ? "" : "not ", oattrib);
180+
- continue;
181+
+ goto next;
182+
}
183+
184+
/* Keep this list in sync with below */
185+
@@ -863,7 +863,7 @@ match_cfg_line(Options *options, const c
186+
debug3("%.200s line %d: skipped exec "
187+
"\"%.100s\"", filename, linenum, cmd);
188+
free(cmd);
189+
- continue;
190+
+ goto next;
191+
}
192+
r = execute_in_shell(cmd);
193+
if (r == -1) {
194+
@@ -887,6 +887,7 @@ match_cfg_line(Options *options, const c
195+
criteria == NULL ? "" : " \"",
196+
criteria == NULL ? "" : criteria,
197+
criteria == NULL ? "" : "\"");
198+
+next:
199+
free(criteria);
200+
free(oattrib);
201+
oattrib = attrib = NULL;
178202
@@ -1847,6 +1847,7 @@ parse_pubkey_algos:
179203
} else if (r != 0) {
180204
error("%.200s line %d: glob failed for %s.",
@@ -186,6 +210,108 @@ diff -up openssh-8.5p1/readconf.c.coverity openssh-8.5p1/readconf.c
186210
diff -up openssh-7.4p1/servconf.c.coverity openssh-7.4p1/servconf.c
187211
--- openssh-7.4p1/servconf.c.coverity 2016-12-23 16:40:26.896788690 +0100
188212
+++ openssh-7.4p1/servconf.c 2016-12-23 16:40:26.901788691 +0100
213+
@@ -1120,12 +1120,12 @@ match_cfg_line(const char *full_line, in
214+
}
215+
216+
while ((oattrib = argv_next(acp, avp)) != NULL) {
217+
- attrib = xstrdup(oattrib);
218+
/* Terminate on comment */
219+
- if (*attrib == '#') {
220+
+ if (*oattrib == '#') {
221+
argv_consume(acp); /* mark all arguments consumed */
222+
break;
223+
}
224+
+ attrib = xstrdup(oattrib);
225+
arg = NULL;
226+
attributes++;
227+
/* Criterion "all" has no argument and must appear alone */
228+
@@ -1147,13 +1147,13 @@ match_cfg_line(const char *full_line, in
229+
if (strcasecmp(attrib, "invalid-user") == 0) {
230+
if (ci == NULL) {
231+
result = 0;
232+
- continue;
233+
+ goto next;
234+
}
235+
if (ci->user_invalid == 0)
236+
result = 0;
237+
else
238+
debug("matched invalid-user at line %d", line);
239+
- continue;
240+
+ goto next;
241+
}
242+
243+
/* Keep this list in sync with below */
244+
@@ -1179,7 +1179,7 @@ match_cfg_line(const char *full_line, in
245+
if (strcasecmp(attrib, "user") == 0) {
246+
if (ci == NULL || (ci->test && ci->user == NULL)) {
247+
result = 0;
248+
- continue;
249+
+ goto next;
250+
}
251+
if (ci->user == NULL)
252+
match_test_missing_fatal("User", "user");
253+
@@ -1191,7 +1191,7 @@ match_cfg_line(const char *full_line, in
254+
} else if (strcasecmp(attrib, "group") == 0) {
255+
if (ci == NULL || (ci->test && ci->user == NULL)) {
256+
result = 0;
257+
- continue;
258+
+ goto next;
259+
}
260+
if (ci->user == NULL)
261+
match_test_missing_fatal("Group", "user");
262+
@@ -1205,7 +1205,7 @@ match_cfg_line(const char *full_line, in
263+
} else if (strcasecmp(attrib, "host") == 0) {
264+
if (ci == NULL || (ci->test && ci->host == NULL)) {
265+
result = 0;
266+
- continue;
267+
+ goto next;
268+
}
269+
if (ci->host == NULL)
270+
match_test_missing_fatal("Host", "host");
271+
@@ -1220,7 +1220,7 @@ match_cfg_line(const char *full_line, in
272+
fatal("Invalid Match address argument "
273+
"'%s' at line %d", arg, line);
274+
result = 0;
275+
- continue;
276+
+ goto next;
277+
}
278+
if (ci->address == NULL)
279+
match_test_missing_fatal("Address", "addr");
280+
@@ -1244,7 +1244,7 @@ match_cfg_line(const char *full_line, in
281+
"argument '%s' at line %d", arg,
282+
line);
283+
result = 0;
284+
- continue;
285+
+ goto next;
286+
}
287+
if (ci->laddress == NULL)
288+
match_test_missing_fatal("LocalAddress",
289+
@@ -1272,7 +1272,7 @@ match_cfg_line(const char *full_line, in
290+
}
291+
if (ci == NULL || (ci->test && ci->lport == -1)) {
292+
result = 0;
293+
- continue;
294+
+ goto next;
295+
}
296+
if (ci->lport == 0)
297+
match_test_missing_fatal("LocalPort", "lport");
298+
@@ -1286,7 +1286,7 @@ match_cfg_line(const char *full_line, in
299+
} else if (strcasecmp(attrib, "rdomain") == 0) {
300+
if (ci == NULL || (ci->test && ci->rdomain == NULL)) {
301+
result = 0;
302+
- continue;
303+
+ goto next;
304+
}
305+
if (ci->rdomain == NULL)
306+
match_test_missing_fatal("RDomain", "rdomain");
307+
@@ -1300,6 +1300,7 @@ match_cfg_line(const char *full_line, in
308+
result = -1;
309+
goto out;
310+
}
311+
+next:
312+
free(attrib);
313+
attrib = NULL;
314+
}
189315
@@ -1638,8 +1638,9 @@ process_server_config_line(ServerOptions
190316
if (*activep && *charptr == NULL) {
191317
*charptr = tilde_expand_filename(arg, getuid());
@@ -262,3 +388,22 @@ diff -up openssh-8.5p1/ssh-keygen.c.coverity openssh-8.5p1/ssh-keygen.c
262388
} else {
263389
if (strncasecmp(cp, "key:", 4) == 0) {
264390
cp += 4;
391+
diff --color -ruNp a/sshd.c b/sshd.c
392+
--- a/sshd.c 2026-04-01 14:29:14.186736233 +0200
393+
+++ b/sshd.c 2026-04-01 14:36:59.136881819 +0200
394+
@@ -1079,6 +1079,7 @@ server_accept_loop(int *sock_in, int *so
395+
send_rexec_state(config_s[0], cfg);
396+
close(config_s[0]);
397+
free(pfd);
398+
+ free(startup_pollfd);
399+
return;
400+
}
401+
402+
@@ -1111,6 +1112,7 @@ server_accept_loop(int *sock_in, int *so
403+
log_stderr);
404+
close(config_s[0]);
405+
free(pfd);
406+
+ free(startup_pollfd);
407+
return;
408+
}
409+

SOURCES/openssh-7.2p2-x11.patch

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ diff --git a/channels.c b/channels.c
3232
return -1;
3333
}
3434

35-
@@ -5099,8 +5102,18 @@
35+
@@ -5099,8 +5102,19 @@
3636
connect_local_xsocket(u_int dnr)
3737
{
3838
char buf[1024];
@@ -41,10 +41,11 @@ diff --git a/channels.c b/channels.c
4141
+ int len, ret;
4242
+ len = snprintf(buf + 1, sizeof (buf) - 1, _PATH_UNIX_X, dnr);
4343
+#ifdef linux
44-
+ /* try abstract socket first */
45-
+ buf[0] = '\0';
46-
+ if ((ret = connect_local_xsocket_path(buf, len + 1)) >= 0)
47-
+ return ret;
44+
+ if (getenv("SSH_INSECURE_ABSTRACT_SOCKET_ENABLED") != NULL) {
45+
+ buf[0] = '\0';
46+
+ if ((ret = connect_local_xsocket_path(buf, len + 1)) >= 0)
47+
+ return ret;
48+
+ }
4849
+#endif
4950
+ if ((ret = connect_local_xsocket_path(buf + 1, len)) >= 0)
5051
+ return ret;

SOURCES/openssh-7.6p1-audit.patch

Lines changed: 40 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ diff -up openssh-8.6p1/Makefile.in.audit openssh-8.6p1/Makefile.in
10861086
--- openssh-8.6p1/Makefile.in.audit 2021-04-19 16:47:35.731061937 +0200
10871087
+++ openssh-8.6p1/Makefile.in 2021-04-19 16:47:35.756062129 +0200
10881088
@@ -112,7 +112,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
1089-
kexsntrup761x25519.o sntrup761.o kexgen.o \
1089+
kexsntrup761x25519.o kexmlkem768x25519.o sntrup761.o kexgen.o \
10901090
kexgssc.o \
10911091
sftp-realpath.o platform-pledge.o platform-tracing.o platform-misc.o \
10921092
- sshbuf-io.o
@@ -2056,14 +2056,50 @@ diff -up openssh-8.6p1/sshd-session.c.audit openssh-8.6p1/sshd-session.c
20562056
#include "ssh-sandbox.h"
20572057
#include "auth-options.h"
20582058
#include "version.h"
2059-
@@ -260,8 +261,8 @@ struct sshbuf *loginmsg;
2059+
@@ -260,8 +261,44 @@ struct sshbuf *loginmsg;
20602060
struct sshbuf *loginmsg;
20612061

20622062
/* Prototypes for various functions defined later in this file. */
20632063
-void destroy_sensitive_data(void);
20642064
-void demote_sensitive_data(void);
20652065
+void destroy_sensitive_data(struct ssh *);
20662066
+void demote_sensitive_data(struct ssh *);
2067+
+
2068+
+static int
2069+
+sshkey_is_private(const struct sshkey *k)
2070+
+{
2071+
+ switch (k->type) {
2072+
+#ifdef WITH_OPENSSL
2073+
+ case KEY_RSA_CERT:
2074+
+ case KEY_RSA: {
2075+
+ const BIGNUM *d;
2076+
+ const RSA *rsa = EVP_PKEY_get0_RSA(k->pkey);
2077+
+ RSA_get0_key(rsa, NULL, NULL, &d);
2078+
+ return d != NULL;
2079+
+ }
2080+
+ case KEY_DSA_CERT:
2081+
+ case KEY_DSA: {
2082+
+ const BIGNUM *priv_key;
2083+
+ DSA_get0_key(k->dsa, NULL, &priv_key);
2084+
+ return priv_key != NULL;
2085+
+ }
2086+
+#ifdef OPENSSL_HAS_ECC
2087+
+ case KEY_ECDSA_CERT:
2088+
+ case KEY_ECDSA: {
2089+
+ const EC_KEY * ecdsa = EVP_PKEY_get0_EC_KEY(k->pkey);
2090+
+ return EC_KEY_get0_private_key(ecdsa) != NULL;
2091+
+ }
2092+
+#endif /* OPENSSL_HAS_ECC */
2093+
+#endif /* WITH_OPENSSL */
2094+
+ case KEY_ED25519_CERT:
2095+
+ case KEY_ED25519:
2096+
+ return (k->ed25519_sk != NULL);
2097+
+ default:
2098+
+ /* fatal("key_is_private: bad key type %d", k->type); */
2099+
+ return 0;
2100+
+ }
2101+
+}
2102+
+
20672103
static void do_ssh2_kex(struct ssh *);
20682104

20692105
/*
@@ -2222,7 +2258,7 @@ diff -up openssh-8.6p1/sshd-session.c.audit openssh-8.6p1/sshd-session.c
22222258

22232259
if (the_active_state != NULL && the_authctxt != NULL) {
22242260
@@ -2525,7 +2593,9 @@ cleanup_exit(int i)
2225-
_exit(EXIT_AUTH_ATTEMPTED);
2261+
}
22262262
#ifdef SSH_AUDIT_EVENTS
22272263
/* done after do_cleanup so it can cancel the PAM auth 'thread' */
22282264
- if (the_active_state != NULL && mm_is_monitor())
@@ -2231,57 +2267,4 @@ diff -up openssh-8.6p1/sshd-session.c.audit openssh-8.6p1/sshd-session.c
22312267
+ mm_is_monitor())
22322268
audit_event(the_active_state, SSH_CONNECTION_ABANDON);
22332269
#endif
2234-
_exit(i);
2235-
diff -up openssh-8.6p1/sshkey.c.audit openssh-8.6p1/sshkey.c
2236-
--- openssh-8.6p1/sshkey.c.audit 2021-04-19 16:47:35.741062014 +0200
2237-
+++ openssh-8.6p1/sshkey.c 2021-04-19 16:47:35.759062152 +0200
2238-
@@ -371,6 +371,38 @@ sshkey_type_is_valid_ca(int type)
2239-
}
2240-
2241-
int
2242-
+sshkey_is_private(const struct sshkey *k)
2243-
+{
2244-
+ switch (k->type) {
2245-
+#ifdef WITH_OPENSSL
2246-
+ case KEY_RSA_CERT:
2247-
+ case KEY_RSA: {
2248-
+ const BIGNUM *d;
2249-
+ RSA_get0_key(k->rsa, NULL, NULL, &d);
2250-
+ return d != NULL;
2251-
+ }
2252-
+ case KEY_DSA_CERT:
2253-
+ case KEY_DSA: {
2254-
+ const BIGNUM *priv_key;
2255-
+ DSA_get0_key(k->dsa, NULL, &priv_key);
2256-
+ return priv_key != NULL;
2257-
+ }
2258-
+#ifdef OPENSSL_HAS_ECC
2259-
+ case KEY_ECDSA_CERT:
2260-
+ case KEY_ECDSA:
2261-
+ return EC_KEY_get0_private_key(k->ecdsa) != NULL;
2262-
+#endif /* OPENSSL_HAS_ECC */
2263-
+#endif /* WITH_OPENSSL */
2264-
+ case KEY_ED25519_CERT:
2265-
+ case KEY_ED25519:
2266-
+ return (k->ed25519_pk != NULL);
2267-
+ default:
2268-
+ /* fatal("key_is_private: bad key type %d", k->type); */
2269-
+ return 0;
2270-
+ }
2271-
+}
2272-
+
2273-
+int
2274-
sshkey_is_cert(const struct sshkey *k)
2275-
{
2276-
if (k == NULL)
2277-
diff -up openssh-8.6p1/sshkey.h.audit openssh-8.6p1/sshkey.h
2278-
--- openssh-8.6p1/sshkey.h.audit 2021-04-19 16:47:35.741062014 +0200
2279-
+++ openssh-8.6p1/sshkey.h 2021-04-19 16:47:35.759062152 +0200
2280-
@@ -189,6 +189,7 @@ int sshkey_shield_private(struct sshke
2281-
int sshkey_unshield_private(struct sshkey *);
2282-
2283-
int sshkey_type_from_name(const char *);
2284-
+int sshkey_is_private(const struct sshkey *);
2285-
int sshkey_is_cert(const struct sshkey *);
2286-
int sshkey_is_sk(const struct sshkey *);
2287-
int sshkey_type_is_cert(int);
2270+
/* Override default fatal exit value when auth was attempted */

0 commit comments

Comments
 (0)