public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openssh] f45: Rebasing OpenSSH to 10.6p1
@ 2026-10-21 16:28 Dmitry Belyavskiy
  0 siblings, 0 replies; only message in thread
From: Dmitry Belyavskiy @ 2026-10-21 16:28 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/openssh
Branch : f45
Commit : 25e13d1e4990f334db983348f2feeefb321c5f97
Author : Dmitry Belyavskiy <dbelyavs@redhat.com>
Date   : 2026-10-21T18:26:14+02:00
Stats  : +740/-750 in 56 file(s)
URL    : https://src.fedoraproject.org/rpms/openssh/c/25e13d1e4990f334db983348f2feeefb321c5f97?branch=f45

Log:
Rebasing OpenSSH to 10.6p1

---
diff --git a/.gitignore b/.gitignore
index 4a58f8c..3d35209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,3 +74,5 @@ pam_ssh_agent_auth-0.9.2.tar.bz2
 /openssh-10.4p1.tar.gz.asc
 /openssh-10.5p1.tar.gz
 /openssh-10.5p1.tar.gz.asc
+/openssh-10.6p1.tar.gz
+/openssh-10.6p1.tar.gz.asc

diff --git a/0001-openssh-6.7p1-coverity.patch b/0001-openssh-6.7p1-coverity.patch
index b2b01f5..29717e2 100644
--- a/0001-openssh-6.7p1-coverity.patch
+++ b/0001-openssh-6.7p1-coverity.patch
@@ -1,4 +1,4 @@
-From fa6f77d16574bf45434431c2fd60fcd34e9a0c8f Mon Sep 17 00:00:00 2001
+From bbc321ac230fc4d16357c598e9b1e1650b913b25 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Fri, 7 Aug 2026 17:25:07 +0200
 Subject: [PATCH 01/53] openssh-6.7p1-coverity
@@ -60,10 +60,10 @@ index 7499aa975..2807cad4a 100644
  	    MIN_SIZEOF(ut->ut_host, li->hostname));
  # endif
 diff --git a/misc.c b/misc.c
-index 517fa7a97..88dc78821 100644
+index 866f7b8e2..f44aa98d8 100644
 --- a/misc.c
 +++ b/misc.c
-@@ -1612,6 +1612,8 @@ sanitise_stdfd(void)
+@@ -1625,6 +1625,8 @@ sanitise_stdfd(void)
  	}
  	if (nullfd > STDERR_FILENO)
  		close(nullfd);
@@ -72,7 +72,7 @@ index 517fa7a97..88dc78821 100644
  }
  
  char *
-@@ -2815,6 +2817,7 @@ stdfd_devnull(int do_stdin, int do_stdout, int do_stderr)
+@@ -2829,6 +2831,7 @@ stdfd_devnull(int do_stdin, int do_stdout, int do_stderr)
  	}
  	if (devnull > STDERR_FILENO)
  		close(devnull);
@@ -81,7 +81,7 @@ index 517fa7a97..88dc78821 100644
  }
  
 diff --git a/monitor.c b/monitor.c
-index 149671145..0e5871994 100644
+index 940dc275a..5630e8855 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -367,7 +367,7 @@ monitor_child_preauth(struct ssh *ssh, struct monitor *pmonitor)
@@ -147,10 +147,10 @@ index 26bdc3e08..8e2939b95 100644
  		FD_CLR(notify_pipe[0], readset);
  	}
 diff --git a/readconf.c b/readconf.c
-index bc48b4f55..7465216f3 100644
+index 9b557dedf..e80db7527 100644
 --- a/readconf.c
 +++ b/readconf.c
-@@ -2111,6 +2111,7 @@ parse_pubkey_algos:
+@@ -2121,6 +2121,7 @@ parse_pubkey_algos:
  			} else if (r != 0) {
  				error("%.200s line %d: glob failed for %s.",
  				    filename, linenum, arg2);
@@ -159,10 +159,10 @@ index bc48b4f55..7465216f3 100644
  			}
  			free(arg2);
 diff --git a/servconf.c b/servconf.c
-index ac0c31d95..e7819d59a 100644
+index 044043b74..bfb227a03 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -2026,8 +2026,9 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -2099,8 +2099,9 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		if (*activep && *charptr == NULL) {
  			*charptr = tilde_expand_filename(arg, getuid());
  			/* increase optional counter */
@@ -188,5 +188,5 @@ index 9d8a3429e..c22681483 100644
  		    auth_opts->force_tun_device != (int)tun)
  			goto done;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0002-Add-SELinux-role-and-MLS-Multi-Level-Security-suppor.patch b/0002-Add-SELinux-role-and-MLS-Multi-Level-Security-suppor.patch
index a7f7030..891681c 100644
--- a/0002-Add-SELinux-role-and-MLS-Multi-Level-Security-suppor.patch
+++ b/0002-Add-SELinux-role-and-MLS-Multi-Level-Security-suppor.patch
@@ -1,4 +1,4 @@
-From 3c47f2bb223e4e400fac08c12bf36a2a88fa55ba Mon Sep 17 00:00:00 2001
+From 2e901e0c17cf7907d374e45d8d998852f8165dd0 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 13 Apr 2026 14:06:32 +0200
 Subject: [PATCH 02/53] Add SELinux role and MLS (Multi-Level Security) support
@@ -35,10 +35,10 @@ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  10 files changed, 131 insertions(+), 8 deletions(-)
 
 diff --git a/auth.h b/auth.h
-index 0f11458ca..efe819323 100644
+index 17227cffb..ca6f507cc 100644
 --- a/auth.h
 +++ b/auth.h
-@@ -65,6 +65,9 @@ struct Authctxt {
+@@ -67,6 +67,9 @@ struct Authctxt {
  	char		*service;
  	struct passwd	*pw;		/* set if 'valid' */
  	char		*style;
@@ -85,10 +85,10 @@ index 9e9496e53..553fba328 100644
  
  	if (!authenticated)
 diff --git a/auth2-hostbased.c b/auth2-hostbased.c
-index 564a8d3cc..6a6704d93 100644
+index cca06745e..4322d7b4f 100644
 --- a/auth2-hostbased.c
 +++ b/auth2-hostbased.c
-@@ -131,7 +131,16 @@ userauth_hostbased(struct ssh *ssh, const char *method)
+@@ -138,7 +138,16 @@ userauth_hostbased(struct ssh *ssh, const char *method)
  	/* reconstruct packet */
  	if ((r = sshbuf_put_stringb(b, ssh->kex->session_id)) != 0 ||
  	    (r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 ||
@@ -106,7 +106,7 @@ index 564a8d3cc..6a6704d93 100644
  	    (r = sshbuf_put_cstring(b, method)) != 0 ||
  	    (r = sshbuf_put_string(b, pkalg, alen)) != 0 ||
 diff --git a/auth2-pubkey.c b/auth2-pubkey.c
-index c15b1ba71..dc07faa92 100644
+index 1a4afd473..88cbab533 100644
 --- a/auth2-pubkey.c
 +++ b/auth2-pubkey.c
 @@ -71,6 +71,8 @@
@@ -118,7 +118,7 @@ index c15b1ba71..dc07faa92 100644
  extern struct authmethod_cfg methodcfg_pubkey;
  
  static char *
-@@ -201,9 +203,16 @@ userauth_pubkey(struct ssh *ssh, const char *method)
+@@ -223,9 +225,16 @@ userauth_pubkey(struct ssh *ssh, const char *method)
  			goto done;
  		}
  		/* reconstruct packet */
@@ -137,7 +137,7 @@ index c15b1ba71..dc07faa92 100644
  		if ((r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 ||
  		    (r = sshbuf_put_cstring(b, userstyle)) != 0 ||
  		    (r = sshbuf_put_cstring(b, authctxt->service)) != 0 ||
-@@ -473,7 +482,8 @@ match_principals_command(struct passwd *user_pw, const struct sshkey *key,
+@@ -510,7 +519,8 @@ match_principals_command(struct passwd *user_pw, const struct sshkey *key,
  	if ((pid = subprocess("AuthorizedPrincipalsCommand", command,
  	    ac, av, &f,
  	    SSH_SUBPROCESS_STDOUT_CAPTURE|SSH_SUBPROCESS_STDERR_DISCARD,
@@ -147,7 +147,7 @@ index c15b1ba71..dc07faa92 100644
  		goto out;
  
  	uid_swapped = 1;
-@@ -749,7 +759,8 @@ user_key_command_allowed2(struct passwd *user_pw, struct sshkey *key,
+@@ -786,7 +796,8 @@ user_key_command_allowed2(struct passwd *user_pw, struct sshkey *key,
  	if ((pid = subprocess("AuthorizedKeysCommand", command,
  	    ac, av, &f,
  	    SSH_SUBPROCESS_STDOUT_CAPTURE|SSH_SUBPROCESS_STDERR_DISCARD,
@@ -158,7 +158,7 @@ index c15b1ba71..dc07faa92 100644
  
  	uid_swapped = 1;
 diff --git a/auth2.c b/auth2.c
-index 3f353a719..497fa8ed2 100644
+index 2da7a4da9..f4f72270d 100644
 --- a/auth2.c
 +++ b/auth2.c
 @@ -277,6 +277,9 @@ input_userauth_request(int type, uint32_t seq, struct ssh *ssh)
@@ -204,10 +204,10 @@ index 3f353a719..497fa8ed2 100644
  		if ((r = kex_server_update_ext_info(ssh)) != 0)
  			fatal_fr(r, "kex_server_update_ext_info failed");
 diff --git a/misc.c b/misc.c
-index 88dc78821..f5275d108 100644
+index f44aa98d8..a38dd7a36 100644
 --- a/misc.c
 +++ b/misc.c
-@@ -869,6 +869,7 @@ char *
+@@ -882,6 +882,7 @@ char *
  colon(char *cp)
  {
  	int flag = 0;
@@ -215,7 +215,7 @@ index 88dc78821..f5275d108 100644
  
  	if (*cp == ':')		/* Leading colon is part of file name. */
  		return NULL;
-@@ -884,6 +885,13 @@ colon(char *cp)
+@@ -897,6 +898,13 @@ colon(char *cp)
  			return (cp);
  		if (*cp == '/')
  			return NULL;
@@ -229,7 +229,7 @@ index 88dc78821..f5275d108 100644
  	}
  	return NULL;
  }
-@@ -2833,7 +2841,8 @@ stdfd_devnull(int do_stdin, int do_stdout, int do_stderr)
+@@ -2847,7 +2855,8 @@ stdfd_devnull(int do_stdin, int do_stdout, int do_stderr)
  pid_t
  subprocess(const char *tag, const char *command,
      int ac, char **av, FILE **child, u_int flags,
@@ -239,7 +239,7 @@ index 88dc78821..f5275d108 100644
  {
  	FILE *f = NULL;
  	struct stat st;
-@@ -2966,6 +2975,13 @@ subprocess(const char *tag, const char *command,
+@@ -2980,6 +2989,13 @@ subprocess(const char *tag, const char *command,
  			error("%s: dup2: %s", tag, strerror(errno));
  			_exit(1);
  		}
@@ -254,7 +254,7 @@ index 88dc78821..f5275d108 100644
  			execve(av[0], av, env);
  		else
 diff --git a/monitor.c b/monitor.c
-index 0e5871994..c659e99e0 100644
+index 5630e8855..eb9703c06 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -111,6 +111,9 @@ int mm_answer_sign(struct ssh *, int, struct sshbuf *);
@@ -366,10 +366,10 @@ index fe0b00b2e..1b46e794e 100644
  	MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103,
  	MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105,
 diff --git a/monitor_wrap.c b/monitor_wrap.c
-index e9a771b34..af0252964 100644
+index c828fce04..a909950b5 100644
 --- a/monitor_wrap.c
 +++ b/monitor_wrap.c
-@@ -440,6 +440,27 @@ mm_inform_authserv(char *service, char *style)
+@@ -443,6 +443,27 @@ mm_inform_authserv(char *service, char *style)
  	sshbuf_free(m);
  }
  
@@ -412,5 +412,5 @@ index f43759b21..30585187c 100644
  char *mm_auth2_read_banner(void);
  int mm_auth_password(struct ssh *, char *);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0003-Implement-SELinux-environment-variable-setup-for-sub.patch b/0003-Implement-SELinux-environment-variable-setup-for-sub.patch
index 62edf2c..7ca3af4 100644
--- a/0003-Implement-SELinux-environment-variable-setup-for-sub.patch
+++ b/0003-Implement-SELinux-environment-variable-setup-for-sub.patch
@@ -1,4 +1,4 @@
-From c5df0bfbb8de0b1536476f200a9af3ecf0c10485 Mon Sep 17 00:00:00 2001
+From a7151c0c1eb4dbb24a126142142adf9dfcc9b03f Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 13 Apr 2026 14:06:47 +0200
 Subject: [PATCH 03/53] Implement SELinux environment variable setup for
@@ -29,14 +29,14 @@ Changes:
 
 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
 ---
- auth-pam.c                       |   2 +-
- auth-pam.h                       |   3 +-
- openbsd-compat/Makefile.in       |   3 +-
- openbsd-compat/port-linux-sshd.c | 454 +++++++++++++++++++++++++++++++
- openbsd-compat/port-linux.c      |  37 +--
- openbsd-compat/port-linux.h      |   5 +-
- platform.c                       |   8 +-
- sshd-session.c                   |   7 +-
+ auth-pam.c                          |   2 +-
+ auth-pam.h                          |   3 +-
+ openbsd-compat/Makefile.in          |   3 +-
+ openbsd-compat/port-linux-selinux.c |  37 +--
+ openbsd-compat/port-linux-sshd.c    | 454 ++++++++++++++++++++++++++++
+ openbsd-compat/port-linux.h         |   5 +-
+ platform.c                          |   8 +-
+ sshd-session.c                      |   7 +-
  8 files changed, 480 insertions(+), 39 deletions(-)
  create mode 100644 openbsd-compat/port-linux-sshd.c
 
@@ -68,10 +68,10 @@ index 491336701..f9167cfc8 100644
  char ** fetch_pam_child_environment(void);
  void free_pam_environment(char **);
 diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
-index 53c87db6d..39531ae77 100644
+index 643aefed6..b2ae7a7c8 100644
 --- a/openbsd-compat/Makefile.in
 +++ b/openbsd-compat/Makefile.in
-@@ -102,7 +102,8 @@ PORTS=	port-aix.o \
+@@ -103,7 +103,8 @@ PORTS=	port-aix.o \
  	port-prngd.o \
  	port-solaris.o \
  	port-net.o \
@@ -81,6 +81,61 @@ index 53c87db6d..39531ae77 100644
  
  .c.o:
  	$(CC) $(CFLAGS_NOPIE) $(PICFLAG) $(CPPFLAGS) -c $<
+diff --git a/openbsd-compat/port-linux-selinux.c b/openbsd-compat/port-linux-selinux.c
+index e36e2ec94..2b6a26b8b 100644
+--- a/openbsd-compat/port-linux-selinux.c
++++ b/openbsd-compat/port-linux-selinux.c
+@@ -105,37 +105,6 @@ ssh_selinux_getctxbyname(char *pwname)
+ 	return sc;
+ }
+ 
+-/* Set the execution context to the default for the specified user */
+-void
+-ssh_selinux_setup_exec_context(char *pwname)
+-{
+-	char *user_ctx = NULL;
+-
+-	if (!ssh_selinux_enabled())
+-		return;
+-
+-	debug3("%s: setting execution context", __func__);
+-
+-	user_ctx = ssh_selinux_getctxbyname(pwname);
+-	if (setexeccon(user_ctx) != 0) {
+-		switch (security_getenforce()) {
+-		case -1:
+-			fatal("%s: security_getenforce() failed", __func__);
+-		case 0:
+-			error("%s: Failed to set SELinux execution "
+-			    "context for %s", __func__, pwname);
+-			break;
+-		default:
+-			fatal("%s: Failed to set SELinux execution context "
+-			    "for %s (in enforcing mode)", __func__, pwname);
+-		}
+-	}
+-	if (user_ctx != NULL)
+-		freecon(user_ctx);
+-
+-	debug3("%s: done", __func__);
+-}
+-
+ /* Set the TTY context for the specified user */
+ void
+ ssh_selinux_setup_pty(char *pwname, const char *tty)
+@@ -148,7 +117,11 @@ ssh_selinux_setup_pty(char *pwname, const char *tty)
+ 
+ 	debug3("%s: setting TTY context on %s", __func__, tty);
+ 
+-	user_ctx = ssh_selinux_getctxbyname(pwname);
++	if (getexeccon(&user_ctx) != 0) {
++		error_f("getexeccon: %s", strerror(errno));
++		goto out;
++	}
++
+ 
+ 	/* XXX: should these calls fatal() upon failure in enforcing mode? */
+ 
 diff --git a/openbsd-compat/port-linux-sshd.c b/openbsd-compat/port-linux-sshd.c
 new file mode 100644
 index 000000000..ab083a637
@@ -541,61 +596,6 @@ index 000000000..ab083a637
 +#endif
 +#endif
 +
-diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
-index c1d54f38d..7426f6f79 100644
---- a/openbsd-compat/port-linux.c
-+++ b/openbsd-compat/port-linux.c
-@@ -109,37 +109,6 @@ ssh_selinux_getctxbyname(char *pwname)
- 	return sc;
- }
- 
--/* Set the execution context to the default for the specified user */
--void
--ssh_selinux_setup_exec_context(char *pwname)
--{
--	char *user_ctx = NULL;
--
--	if (!ssh_selinux_enabled())
--		return;
--
--	debug3("%s: setting execution context", __func__);
--
--	user_ctx = ssh_selinux_getctxbyname(pwname);
--	if (setexeccon(user_ctx) != 0) {
--		switch (security_getenforce()) {
--		case -1:
--			fatal("%s: security_getenforce() failed", __func__);
--		case 0:
--			error("%s: Failed to set SELinux execution "
--			    "context for %s", __func__, pwname);
--			break;
--		default:
--			fatal("%s: Failed to set SELinux execution context "
--			    "for %s (in enforcing mode)", __func__, pwname);
--		}
--	}
--	if (user_ctx != NULL)
--		freecon(user_ctx);
--
--	debug3("%s: done", __func__);
--}
--
- /* Set the TTY context for the specified user */
- void
- ssh_selinux_setup_pty(char *pwname, const char *tty)
-@@ -152,7 +121,11 @@ ssh_selinux_setup_pty(char *pwname, const char *tty)
- 
- 	debug3("%s: setting TTY context on %s", __func__, tty);
- 
--	user_ctx = ssh_selinux_getctxbyname(pwname);
-+	if (getexeccon(&user_ctx) != 0) {
-+		error_f("getexeccon: %s", strerror(errno));
-+		goto out;
-+	}
-+
- 
- 	/* XXX: should these calls fatal() upon failure in enforcing mode? */
- 
 diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h
 index 959430de1..26c5f773b 100644
 --- a/openbsd-compat/port-linux.h
@@ -648,7 +648,7 @@ index fd1a7a7c2..66d0c2a6b 100644
  }
  
 diff --git a/sshd-session.c b/sshd-session.c
-index 06a72daaf..1a40a43f1 100644
+index 1af9bcf4c..54af7fdf4 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
 @@ -123,7 +123,7 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE;
@@ -660,7 +660,7 @@ index 06a72daaf..1a40a43f1 100644
  
  /* debug goes to stderr unless inetd_flag is set */
  static int log_stderr = 0;
-@@ -1277,6 +1277,11 @@ main(int ac, char **av)
+@@ -1264,6 +1264,11 @@ main(int ac, char **av)
  		restore_uid();
  	}
  #endif
@@ -673,5 +673,5 @@ index 06a72daaf..1a40a43f1 100644
  	if (options.use_pam) {
  		do_pam_setcred();
 -- 
-2.55.0
+2.56.0
 

diff --git a/0004-Pass-inetd-flags-and-auth-context-to-subprocess-call.patch b/0004-Pass-inetd-flags-and-auth-context-to-subprocess-call.patch
index e77ac29..ac46a5f 100644
--- a/0004-Pass-inetd-flags-and-auth-context-to-subprocess-call.patch
+++ b/0004-Pass-inetd-flags-and-auth-context-to-subprocess-call.patch
@@ -1,4 +1,4 @@
-From e63a4ad30d07f0912f63360263985d7aef948565 Mon Sep 17 00:00:00 2001
+From ca95ea01edf9a7d855c959bf6a0b1b1fc3881a9b Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 13 Apr 2026 14:07:02 +0200
 Subject: [PATCH 04/53] Pass inetd flags and auth context to subprocess calls
@@ -31,10 +31,10 @@ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/misc.h b/misc.h
-index 791876c1e..fe11f9d8a 100644
+index 0784f379b..d79925de1 100644
 --- a/misc.h
 +++ b/misc.h
-@@ -129,7 +129,7 @@ typedef void privrestore_fn(void);
+@@ -131,7 +131,7 @@ typedef void privrestore_fn(void);
  #define	SSH_SUBPROCESS_UNSAFE_PATH	(1<<3)	/* Don't check for safe cmd */
  #define	SSH_SUBPROCESS_PRESERVE_ENV	(1<<4)	/* Keep parent environment */
  pid_t subprocess(const char *, const char *, int, char **, FILE **, u_int,
@@ -44,10 +44,10 @@ index 791876c1e..fe11f9d8a 100644
  typedef struct arglist arglist;
  struct arglist {
 diff --git a/sshconnect.c b/sshconnect.c
-index 0ddfc76b3..bdaade682 100644
+index 3349d8e39..e727f1574 100644
 --- a/sshconnect.c
 +++ b/sshconnect.c
-@@ -954,7 +954,7 @@ load_hostkeys_command(struct hostkeys *hostkeys, const char *command_template,
+@@ -952,7 +952,7 @@ load_hostkeys_command(struct hostkeys *hostkeys, const char *command_template,
  
  	if ((pid = subprocess(tag, command, ac, av, &f,
  	    SSH_SUBPROCESS_STDOUT_CAPTURE|SSH_SUBPROCESS_UNSAFE_PATH|
@@ -57,7 +57,7 @@ index 0ddfc76b3..bdaade682 100644
  
  	load_hostkeys_file(hostkeys, hostfile_hostname, tag, f, 1);
 diff --git a/sshd-auth.c b/sshd-auth.c
-index 4888c8e62..14109151c 100644
+index 3adf1a41e..f068d6c67 100644
 --- a/sshd-auth.c
 +++ b/sshd-auth.c
 @@ -119,7 +119,7 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE;
@@ -70,5 +70,5 @@ index 4888c8e62..14109151c 100644
  /* Saved arguments to main(). */
  static char **saved_argv;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0005-openssh-6.6p1-keycat.patch b/0005-openssh-6.6p1-keycat.patch
index bd9a5ef..0a880dd 100644
--- a/0005-openssh-6.6p1-keycat.patch
+++ b/0005-openssh-6.6p1-keycat.patch
@@ -1,4 +1,4 @@
-From 6164d9589be5125b95da999ed6615aa431a42e70 Mon Sep 17 00:00:00 2001
+From 40cb1cdd8561ba61047536c5adce51efcc5a1dd7 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 05/53] openssh-6.6p1-keycat
@@ -15,7 +15,7 @@ Subject: [PATCH 05/53] openssh-6.6p1-keycat
  create mode 100644 ssh-keycat.c
 
 diff --git a/.depend b/.depend
-index 845fadceb..7d2d00bbf 100644
+index 997f1369d..32b9cf875 100644
 --- a/.depend
 +++ b/.depend
 @@ -135,6 +135,7 @@ ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbs
@@ -57,7 +57,7 @@ index 000000000..630ec628c
 +
 +
 diff --git a/Makefile.in b/Makefile.in
-index e9503e7b7..2a449680a 100644
+index ffc13e069..52bc9ac23 100644
 --- a/Makefile.in
 +++ b/Makefile.in
 @@ -23,6 +23,7 @@ SSH_PROGRAM=@bindir@/ssh
@@ -104,10 +104,10 @@ index e9503e7b7..2a449680a 100644
  	$(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
  	$(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
 diff --git a/configure.ac b/configure.ac
-index cb1711f6b..4b3cff38c 100644
+index bb4d065f1..5eaa998d0 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -3639,6 +3639,7 @@ AC_ARG_WITH([pam],
+@@ -3646,6 +3646,7 @@ AC_ARG_WITH([pam],
  			PAM_MSG="yes"
  
  			SSHDLIBS="$SSHDLIBS -lpam"
@@ -115,7 +115,7 @@ index cb1711f6b..4b3cff38c 100644
  			AC_DEFINE([USE_PAM], [1],
  				[Define if you want to enable PAM support])
  
-@@ -3649,6 +3650,7 @@ AC_ARG_WITH([pam],
+@@ -3656,6 +3657,7 @@ AC_ARG_WITH([pam],
  					;;
  				*)
  					SSHDLIBS="$SSHDLIBS -ldl"
@@ -123,7 +123,7 @@ index cb1711f6b..4b3cff38c 100644
  					;;
  				esac
  			fi
-@@ -4892,6 +4894,7 @@ AC_ARG_WITH([selinux],
+@@ -4901,6 +4903,7 @@ AC_ARG_WITH([selinux],
  	fi ]
  )
  AC_SUBST([SSHDLIBS])
@@ -131,7 +131,7 @@ index cb1711f6b..4b3cff38c 100644
  
  # Check whether user wants Kerberos 5 support
  KRB5_MSG="no"
-@@ -5905,6 +5908,9 @@ fi
+@@ -5904,6 +5907,9 @@ fi
  if test ! -z "${SSHDLIBS}"; then
  echo "         +for sshd: ${SSHDLIBS}"
  fi
@@ -389,5 +389,5 @@ index 000000000..8bb17c73e
 +	return ev;
 +}
 -- 
-2.55.0
+2.56.0
 

diff --git a/0006-openssh-6.6p1-allow-ip-opts.patch b/0006-openssh-6.6p1-allow-ip-opts.patch
index b9d390e..d861254 100644
--- a/0006-openssh-6.6p1-allow-ip-opts.patch
+++ b/0006-openssh-6.6p1-allow-ip-opts.patch
@@ -1,4 +1,4 @@
-From b7b287396f0792287ee4be08702ff70876cd401d Mon Sep 17 00:00:00 2001
+From b2a9a77f3e51adbc6d7278766d17103ed7f6dc26 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 06/53] openssh-6.6p1-allow-ip-opts
@@ -9,10 +9,10 @@ Subject: [PATCH 06/53] openssh-6.6p1-allow-ip-opts
  1 file changed, 26 insertions(+), 6 deletions(-)
 
 diff --git a/sshd-session.c b/sshd-session.c
-index 1a40a43f1..0f41756ff 100644
+index 54af7fdf4..2a19260ff 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -727,12 +727,32 @@ check_ip_options(struct ssh *ssh)
+@@ -713,12 +713,32 @@ check_ip_options(struct ssh *ssh)
  
  	if (getsockopt(sock_in, IPPROTO_IP, IP_OPTIONS, opts,
  	    &option_size) >= 0 && option_size != 0) {
@@ -52,5 +52,5 @@ index 1a40a43f1..0f41756ff 100644
  #endif /* IP_OPTIONS */
  }
 -- 
-2.55.0
+2.56.0
 

diff --git a/0007-openssh-5.9p1-ipv6man.patch b/0007-openssh-5.9p1-ipv6man.patch
index 93f77c5..2b93e93 100644
--- a/0007-openssh-5.9p1-ipv6man.patch
+++ b/0007-openssh-5.9p1-ipv6man.patch
@@ -1,4 +1,4 @@
-From bf4e65b7335e516bae78a0bd0c085ab55f377973 Mon Sep 17 00:00:00 2001
+From 8d2df84e6caedbcc0dfdf4bf88c2cb606f3fcdab Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 07/53] openssh-5.9p1-ipv6man
@@ -10,7 +10,7 @@ Subject: [PATCH 07/53] openssh-5.9p1-ipv6man
  2 files changed, 4 insertions(+)
 
 diff --git a/ssh.1 b/ssh.1
-index 60ee3ab34..089bd348a 100644
+index 557cf66d3..4930a51f5 100644
 --- a/ssh.1
 +++ b/ssh.1
 @@ -1579,6 +1579,8 @@ manual page for more information.
@@ -23,7 +23,7 @@ index 60ee3ab34..089bd348a 100644
  .Xr scp 1 ,
  .Xr sftp 1 ,
 diff --git a/sshd.8 b/sshd.8
-index a65aae75d..24e5639a3 100644
+index 92842e345..4bfbeaf63 100644
 --- a/sshd.8
 +++ b/sshd.8
 @@ -1024,6 +1024,8 @@ concurrently for different ports, this contains the process ID of the one
@@ -36,5 +36,5 @@ index a65aae75d..24e5639a3 100644
  .Xr scp 1 ,
  .Xr sftp 1 ,
 -- 
-2.55.0
+2.56.0
 

diff --git a/0008-openssh-5.8p2-sigpipe.patch b/0008-openssh-5.8p2-sigpipe.patch
index 312da67..7d9b66c 100644
--- a/0008-openssh-5.8p2-sigpipe.patch
+++ b/0008-openssh-5.8p2-sigpipe.patch
@@ -1,4 +1,4 @@
-From dccd2a9aba5fa758cfd27c6de86fa73830aa7f6f Mon Sep 17 00:00:00 2001
+From 18b8d12cf0bd125bf46722826eea79790a4368d3 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 08/53] openssh-5.8p2-sigpipe
@@ -8,7 +8,7 @@ Subject: [PATCH 08/53] openssh-5.8p2-sigpipe
  1 file changed, 3 insertions(+)
 
 diff --git a/ssh-keyscan.c b/ssh-keyscan.c
-index f093b0108..77b4341c9 100644
+index c43bebf12..bcfaa174a 100644
 --- a/ssh-keyscan.c
 +++ b/ssh-keyscan.c
 @@ -797,6 +797,9 @@ main(int argc, char **argv)
@@ -22,5 +22,5 @@ index f093b0108..77b4341c9 100644
  	for (j = 0; j < maxfd; j++)
  		read_wait[j].fd = -1;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0009-openssh-5.1p1-askpass-progress.patch b/0009-openssh-5.1p1-askpass-progress.patch
index 9c14332..93161d2 100644
--- a/0009-openssh-5.1p1-askpass-progress.patch
+++ b/0009-openssh-5.1p1-askpass-progress.patch
@@ -1,4 +1,4 @@
-From 993767d6c9c2b2e9cfa6ff2cd3d7bc8c4869c2f6 Mon Sep 17 00:00:00 2001
+From 01144fb895bc9b58c56a1aaaa3460accfb071407 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 09/53] openssh-5.1p1-askpass-progress
@@ -92,5 +92,5 @@ index a62f98152..cb7152dc8 100644
  
  	/* Grab focus */
 -- 
-2.55.0
+2.56.0
 

diff --git a/0010-openssh-4.3p2-askpass-grab-info.patch b/0010-openssh-4.3p2-askpass-grab-info.patch
index af4d057..9f5c712 100644
--- a/0010-openssh-4.3p2-askpass-grab-info.patch
+++ b/0010-openssh-4.3p2-askpass-grab-info.patch
@@ -1,4 +1,4 @@
-From 68609eb845515333fe86756dd0d0f1fe866943ef Mon Sep 17 00:00:00 2001
+From 1a50fefcfb6d01eff7a5f0074d964dda24887233 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 10/53] openssh-4.3p2-askpass-grab-info
@@ -28,5 +28,5 @@ index cb7152dc8..bbe93d838 100644
  
  	gtk_dialog_run(GTK_DIALOG(err));
 -- 
-2.55.0
+2.56.0
 

diff --git a/0011-openssh-8.7p1-redhat.patch b/0011-openssh-8.7p1-redhat.patch
index 23c071d..491a151 100644
--- a/0011-openssh-8.7p1-redhat.patch
+++ b/0011-openssh-8.7p1-redhat.patch
@@ -1,4 +1,4 @@
-From 313333f429aedd5f255643400669204a32e61023 Mon Sep 17 00:00:00 2001
+From a857e54e79d458c45590e5f33890278efc44ee36 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 11/53] openssh-8.7p1-redhat
@@ -76,10 +76,10 @@ index 57ecabb86..f43aa8093 100644
  #AddressFamily any
  #ListenAddress 0.0.0.0
 diff --git a/sshd_config.0 b/sshd_config.0
-index 2248006ea..91eda77f4 100644
+index 985e78b53..a3ed2f568 100644
 --- a/sshd_config.0
 +++ b/sshd_config.0
-@@ -1265,9 +1265,9 @@ DESCRIPTION
+@@ -1292,9 +1292,9 @@ DESCRIPTION
  
       SyslogFacility
               Gives the facility code that is used when logging messages from
@@ -91,12 +91,12 @@ index 2248006ea..91eda77f4 100644
 +             The default is AUTH.
  
       TCPKeepAlive
-              Specifies whether the system should send TCP keepalive messages
+              Specifies whether the system should send keepalive messages on
 diff --git a/sshd_config.5 b/sshd_config.5
-index a7d300139..e85cca6eb 100644
+index 3560ec8b8..4c1b20df8 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -1989,7 +1989,7 @@ By default no subsystems are defined.
+@@ -2029,7 +2029,7 @@ By default no subsystems are defined.
  .It Cm SyslogFacility
  Gives the facility code that is used when logging messages from
  .Xr sshd 8 .
@@ -143,5 +143,5 @@ index 000000000..1d592d13f
 +Include /etc/crypto-policies/back-ends/opensshserver.config
 +
 -- 
-2.55.0
+2.56.0
 

diff --git a/0012-openssh-7.8p1-UsePAM-warning.patch b/0012-openssh-7.8p1-UsePAM-warning.patch
index 0d001bd..7aff058 100644
--- a/0012-openssh-7.8p1-UsePAM-warning.patch
+++ b/0012-openssh-7.8p1-UsePAM-warning.patch
@@ -1,4 +1,4 @@
-From 10feee43540cbebad70f9903a6cbd59409f9f0c4 Mon Sep 17 00:00:00 2001
+From 1290a977c0151b679cb5408271cba8401f74fe03 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 12/53] openssh-7.8p1-UsePAM-warning
@@ -10,10 +10,10 @@ Subject: [PATCH 12/53] openssh-7.8p1-UsePAM-warning
  2 files changed, 6 insertions(+)
 
 diff --git a/sshd-session.c b/sshd-session.c
-index 0f41756ff..6e9b28dec 100644
+index 2a19260ff..c671c782d 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -1076,6 +1076,10 @@ main(int ac, char **av)
+@@ -1062,6 +1062,10 @@ main(int ac, char **av)
  			    "enabled authentication methods");
  	}
  
@@ -38,5 +38,5 @@ index f43aa8093..f626d5801 100644
  
  #AllowAgentForwarding yes
 -- 
-2.55.0
+2.56.0
 

diff --git a/0013-openssh-9.6p1-gssapi-keyex.patch b/0013-openssh-9.6p1-gssapi-keyex.patch
index de2cabf..a075e62 100644
--- a/0013-openssh-9.6p1-gssapi-keyex.patch
+++ b/0013-openssh-9.6p1-gssapi-keyex.patch
@@ -1,4 +1,4 @@
-From 988b543e5a92109f08a6ef213c834eb82924178e Mon Sep 17 00:00:00 2001
+From 0f49823af059037a1358ef5b7e75daa4c803817a Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 13/53] openssh-9.6p1-gssapi-keyex
@@ -16,14 +16,14 @@ Subject: [PATCH 13/53] openssh-9.6p1-gssapi-keyex
  configure.ac    |  24 ++
  gss-genr.c      | 313 ++++++++++++++++++++-
  gss-serv-krb5.c |  97 ++++++-
- gss-serv.c      | 200 ++++++++++++--
+ gss-serv.c      | 192 +++++++++++--
  kex-names.c     |  67 ++++-
  kex.c           |  35 ++-
  kex.h           |  34 +++
  kexdh.c         |  10 +
  kexgen.c        |   2 +-
  kexgssc.c       | 706 ++++++++++++++++++++++++++++++++++++++++++++++++
- kexgsss.c       | 603 +++++++++++++++++++++++++++++++++++++++++
+ kexgsss.c       | 602 +++++++++++++++++++++++++++++++++++++++++
  monitor.c       | 150 +++++++++-
  monitor.h       |   2 +
  monitor_wrap.c  |  57 +++-
@@ -46,12 +46,12 @@ Subject: [PATCH 13/53] openssh-9.6p1-gssapi-keyex
  sshd_config.5   |  43 ++-
  sshkey.c        |  72 ++++-
  sshkey.h        |   1 +
- 42 files changed, 3004 insertions(+), 84 deletions(-)
+ 42 files changed, 2998 insertions(+), 81 deletions(-)
  create mode 100644 kexgssc.c
  create mode 100644 kexgsss.c
 
 diff --git a/.depend b/.depend
-index 7d2d00bbf..45ad2bf4e 100644
+index 32b9cf875..e6722f6e5 100644
 --- a/.depend
 +++ b/.depend
 @@ -67,6 +67,8 @@ kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-com
@@ -64,7 +64,7 @@ index 7d2d00bbf..45ad2bf4e 100644
  kexgexc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/bsd-sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h
  kexgexs.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/bsd-sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h
 diff --git a/Makefile.in b/Makefile.in
-index 2a449680a..1eeb34cad 100644
+index 52bc9ac23..7d16aea62 100644
 --- a/Makefile.in
 +++ b/Makefile.in
 @@ -109,6 +109,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
@@ -232,7 +232,7 @@ index 99637a89b..a05908cf3 100644
  #endif
  	&methodcfg_passwd,
 diff --git a/auth2.c b/auth2.c
-index 497fa8ed2..f0f39707f 100644
+index f4f72270d..547ceb95c 100644
 --- a/auth2.c
 +++ b/auth2.c
 @@ -71,6 +71,7 @@ extern Authmethod method_passwd;
@@ -371,7 +371,7 @@ index 26d62855a..0cadc9f18 100644
  int		 get_peer_port(int);
  char		*get_local_ipaddr(int);
 diff --git a/clientloop.c b/clientloop.c
-index 49950cecc..f076d1d56 100644
+index 0df129113..1df805644 100644
 --- a/clientloop.c
 +++ b/clientloop.c
 @@ -101,6 +101,10 @@
@@ -401,10 +401,10 @@ index 49950cecc..f076d1d56 100644
  		if (conn_in_ready)
  			client_process_net_input(ssh);
 diff --git a/configure.ac b/configure.ac
-index 4b3cff38c..cb46903f4 100644
+index 5eaa998d0..c987e44ad 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -844,6 +844,30 @@ int main(void) { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
+@@ -834,6 +834,30 @@ int main(void) { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
  	    [Use tunnel device compatibility to OpenBSD])
  	AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
  	    [Prepend the address family to IP tunnel traffic])
@@ -976,11 +976,11 @@ index 4caac337c..be401fe0e 100644
  
  #endif /* KRB5 */
 diff --git a/gss-serv.c b/gss-serv.c
-index f9ae303b5..8b4fa9cfe 100644
+index 16f653202..bf015aef7 100644
 --- a/gss-serv.c
 +++ b/gss-serv.c
 @@ -1,7 +1,7 @@
- /* $OpenBSD: gss-serv.c,v 1.37 2026/02/11 16:57:38 dtucker Exp $ */
+ /* $OpenBSD: gss-serv.c,v 1.39 2026/09/16 00:37:52 djm Exp $ */
  
  /*
 - * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -1000,10 +1000,9 @@ index f9ae303b5..8b4fa9cfe 100644
  extern ServerOptions options;
  
  static ssh_gssapi_client gssapi_client =
--    { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
--    GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL, NULL}};
-+    { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, GSS_C_NO_CREDENTIAL,
-+    GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0};
+     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
+-    GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL, NULL}, 0};
++    GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, 0};
  
  ssh_gssapi_mech gssapi_null_mech =
 -    { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL};
@@ -1100,9 +1099,9 @@ index f9ae303b5..8b4fa9cfe 100644
 +		return GSS_S_COMPLETE;
 +	}
  
+ 	client->userok = 0;
  	client->mech = NULL;
- 
-@@ -294,6 +361,13 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+@@ -295,6 +362,13 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
  	if (client->mech == NULL)
  		return GSS_S_FAILURE;
  
@@ -1116,7 +1115,7 @@ index f9ae303b5..8b4fa9cfe 100644
  	if ((ctx->major = gss_display_name(&ctx->minor, ctx->client,
  	    &client->displayname, NULL))) {
  		ssh_gssapi_error(ctx);
-@@ -311,6 +385,8 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+@@ -312,6 +386,8 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
  		return (ctx->major);
  	}
  
@@ -1125,7 +1124,7 @@ index f9ae303b5..8b4fa9cfe 100644
  	/* We can't copy this structure, so we just move the pointer to it */
  	client->creds = ctx->client_creds;
  	ctx->client_creds = GSS_C_NO_CREDENTIAL;
-@@ -321,11 +397,20 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+@@ -322,11 +398,20 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
  void
  ssh_gssapi_cleanup_creds(void)
  {
@@ -1151,34 +1150,25 @@ index f9ae303b5..8b4fa9cfe 100644
  	}
  }
  
-@@ -363,19 +448,23 @@ ssh_gssapi_do_child(char ***envp, u_int *envsizep)
+@@ -380,7 +465,7 @@ ssh_gssapi_cleanup_global_client()
  
  /* Privileged */
  int
 -ssh_gssapi_userok(char *user)
 +ssh_gssapi_userok(char *user, struct passwd *pw, int kex)
  {
- 	OM_uint32 lmin;
- 
-+	(void) kex; /* used in privilege separation */
-+
  	if (gssapi_client.exportedname.length == 0 ||
  	    gssapi_client.exportedname.value == NULL) {
- 		debug("No suitable client data");
- 		return 0;
- 	}
+@@ -390,6 +475,8 @@ ssh_gssapi_userok(char *user)
  	if (gssapi_client.mech && gssapi_client.mech->userok)
--		if ((*gssapi_client.mech->userok)(&gssapi_client, user))
-+		if ((*gssapi_client.mech->userok)(&gssapi_client, user)) {
+ 		if ((*gssapi_client.mech->userok)(&gssapi_client, user)) {
+ 			gssapi_client.userok = 1;
 +			gssapi_client.used = 1;
 +			gssapi_client.store.owner = pw;
  			return 1;
--		else {
-+		} else {
+ 		} else {
  			/* Destroy delegated credentials if userok fails */
- 			gss_release_buffer(&lmin, &gssapi_client.displayname);
- 			gss_release_buffer(&lmin, &gssapi_client.exportedname);
-@@ -389,14 +478,85 @@ ssh_gssapi_userok(char *user)
+@@ -401,14 +488,85 @@ ssh_gssapi_userok(char *user)
  	return (0);
  }
  
@@ -1389,10 +1379,10 @@ index 116150316..2bc431223 100644
 +	return 1;
 +}
 diff --git a/kex.c b/kex.c
-index b2c3d9720..1b8f1c3c5 100644
+index d3015e8af..aa3d8d892 100644
 --- a/kex.c
 +++ b/kex.c
-@@ -293,17 +293,37 @@ static int
+@@ -327,17 +327,37 @@ static int
  kex_compose_ext_info_server(struct ssh *ssh, struct sshbuf *m)
  {
  	int r;
@@ -1436,7 +1426,7 @@ index b2c3d9720..1b8f1c3c5 100644
  	    (r = sshbuf_put_cstring(m, "0")) != 0 ||
  	    (r = sshbuf_put_cstring(m, "agent-forward")) != 0 ||
  	    (r = sshbuf_put_cstring(m, "0")) != 0) {
-@@ -744,6 +764,9 @@ kex_free(struct kex *kex)
+@@ -779,6 +799,9 @@ kex_free(struct kex *kex)
  	sshbuf_free(kex->server_version);
  	sshbuf_free(kex->client_pub);
  	sshbuf_free(kex->session_id);
@@ -1447,7 +1437,7 @@ index b2c3d9720..1b8f1c3c5 100644
  	sshkey_free(kex->initial_hostkey);
  	free(kex->failed_choice);
 diff --git a/kex.h b/kex.h
-index 9816b1d83..21919a9aa 100644
+index 4cd6e0b83..7846e7a6e 100644
 --- a/kex.h
 +++ b/kex.h
 @@ -29,6 +29,10 @@
@@ -1477,8 +1467,8 @@ index 9816b1d83..21919a9aa 100644
  	KEX_MAX
  };
  
-@@ -166,6 +179,13 @@ struct kex {
- 	u_int	flags;
+@@ -169,6 +182,13 @@ struct kex {
+ 	u_int	non_pq_kex_warned;
  	int	hash_alg;
  	int	ec_nid;
 +#ifdef GSSAPI
@@ -1491,7 +1481,7 @@ index 9816b1d83..21919a9aa 100644
  	char	*failed_choice;
  	int	(*verify_host_key)(struct sshkey *, struct ssh *);
  	struct sshkey *(*load_host_public_key)(int, int, struct ssh *);
-@@ -193,8 +213,10 @@ int	 kex_nid_from_name(const char *);
+@@ -196,8 +216,10 @@ int	 kex_nid_from_name(const char *);
  int	 kex_is_pq_from_name(const char *);
  int	 kex_names_valid(const char *);
  char	*kex_alg_list(char);
@@ -1502,7 +1492,7 @@ index 9816b1d83..21919a9aa 100644
  int	 kex_assemble_names(char **, const char *, const char *);
  void	 kex_proposal_populate_entries(struct ssh *, char *prop[PROPOSAL_MAX],
      const char *, const char *, const char *, const char *, const char *);
-@@ -228,6 +250,12 @@ int	 kexgex_client(struct ssh *);
+@@ -233,6 +255,12 @@ int	 kexgex_client(struct ssh *);
  int	 kexgex_server(struct ssh *);
  int	 kex_gen_client(struct ssh *);
  int	 kex_gen_server(struct ssh *);
@@ -1515,7 +1505,7 @@ index 9816b1d83..21919a9aa 100644
  
  int	 kex_dh_keypair(struct kex *);
  int	 kex_dh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
-@@ -275,6 +303,12 @@ int	 kexgex_hash(int, const struct sshbuf *, const struct sshbuf *,
+@@ -280,6 +308,12 @@ int	 kexgex_hash(int, const struct sshbuf *, const struct sshbuf *,
      const BIGNUM *, const u_char *, size_t,
      u_char *, size_t *);
  
@@ -1557,7 +1547,7 @@ index cbcb2d836..b63374b0e 100644
  		break;
  	case KEX_DH_GRP18_SHA512:
 diff --git a/kexgen.c b/kexgen.c
-index d1f9d840a..ff504580f 100644
+index 28a40c3f9..c94048a26 100644
 --- a/kexgen.c
 +++ b/kexgen.c
 @@ -44,7 +44,7 @@
@@ -2283,10 +2273,10 @@ index 000000000..6dc31eb0d
 +#endif /* defined(GSSAPI) && defined(WITH_OPENSSL) */
 diff --git a/kexgsss.c b/kexgsss.c
 new file mode 100644
-index 000000000..98e9404df
+index 000000000..98f632ce4
 --- /dev/null
 +++ b/kexgsss.c
-@@ -0,0 +1,603 @@
+@@ -0,0 +1,602 @@
 +/*
 + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved.
 + *
@@ -2333,7 +2323,6 @@ index 000000000..98e9404df
 +#include "monitor_wrap.h"
 +#include "misc.h"      /* servconf.h needs misc.h for struct ForwardOptions */
 +#include "servconf.h"
-+#include "ssh-gss.h"
 +#include "digest.h"
 +#include "ssherr.h"
 +
@@ -2891,7 +2880,7 @@ index 000000000..98e9404df
 +
 +#endif /* defined(GSSAPI) && defined(WITH_OPENSSL) */
 diff --git a/monitor.c b/monitor.c
-index c659e99e0..fa477899e 100644
+index eb9703c06..98f47eaef 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -138,6 +138,8 @@ int mm_answer_gss_setup_ctx(struct ssh *, int, struct sshbuf *);
@@ -2991,9 +2980,9 @@ index c659e99e0..fa477899e 100644
 +	if (!options.gss_authentication && !options.gss_keyex)
 +		fatal_f("GSSAPI not enabled");
  
- 	if ((r = sshbuf_get_string(m, &p, &len)) != 0)
- 		fatal_fr(r, "parse");
-@@ -2040,8 +2074,8 @@ mm_answer_gss_accept_ctx(struct ssh *ssh, int sock, struct sshbuf *m)
+ 	ssh_gssapi_cleanup_global_client();
+ 
+@@ -2042,8 +2076,8 @@ mm_answer_gss_accept_ctx(struct ssh *ssh, int sock, struct sshbuf *m)
  	OM_uint32 flags = 0; /* GSI needs this */
  	int r;
  
@@ -3004,7 +2993,7 @@ index c659e99e0..fa477899e 100644
  
  	if ((r = ssh_gssapi_get_buffer_desc(m, &in)) != 0)
  		fatal_fr(r, "ssh_gssapi_get_buffer_desc");
-@@ -2061,6 +2095,7 @@ mm_answer_gss_accept_ctx(struct ssh *ssh, int sock, struct sshbuf *m)
+@@ -2063,6 +2097,7 @@ mm_answer_gss_accept_ctx(struct ssh *ssh, int sock, struct sshbuf *m)
  		monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0);
  		monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1);
  		monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1);
@@ -3012,7 +3001,7 @@ index c659e99e0..fa477899e 100644
  	}
  	return (0);
  }
-@@ -2072,8 +2107,8 @@ mm_answer_gss_checkmic(struct ssh *ssh, int sock, struct sshbuf *m)
+@@ -2074,8 +2109,8 @@ mm_answer_gss_checkmic(struct ssh *ssh, int sock, struct sshbuf *m)
  	OM_uint32 ret;
  	int r;
  
@@ -3023,7 +3012,7 @@ index c659e99e0..fa477899e 100644
  
  	if ((r = ssh_gssapi_get_buffer_desc(m, &gssbuf)) != 0 ||
  	    (r = ssh_gssapi_get_buffer_desc(m, &mic)) != 0)
-@@ -2099,13 +2134,17 @@ mm_answer_gss_checkmic(struct ssh *ssh, int sock, struct sshbuf *m)
+@@ -2101,13 +2136,17 @@ mm_answer_gss_checkmic(struct ssh *ssh, int sock, struct sshbuf *m)
  int
  mm_answer_gss_userok(struct ssh *ssh, int sock, struct sshbuf *m)
  {
@@ -3045,7 +3034,7 @@ index c659e99e0..fa477899e 100644
  
  	sshbuf_reset(m);
  	if ((r = sshbuf_put_u32(m, authenticated)) != 0)
-@@ -2114,7 +2153,11 @@ mm_answer_gss_userok(struct ssh *ssh, int sock, struct sshbuf *m)
+@@ -2116,7 +2155,11 @@ mm_answer_gss_userok(struct ssh *ssh, int sock, struct sshbuf *m)
  	debug3_f("sending result %d", authenticated);
  	mm_request_send(sock, MONITOR_ANS_GSSUSEROK, m);
  
@@ -3058,7 +3047,7 @@ index c659e99e0..fa477899e 100644
  
  	if ((displayname = ssh_gssapi_displayname()) != NULL)
  		auth2_record_info(authctxt, "%s", displayname);
-@@ -2122,5 +2165,84 @@ mm_answer_gss_userok(struct ssh *ssh, int sock, struct sshbuf *m)
+@@ -2124,5 +2167,84 @@ mm_answer_gss_userok(struct ssh *ssh, int sock, struct sshbuf *m)
  	/* Monitor loop will terminate if authenticated */
  	return (authenticated);
  }
@@ -3157,10 +3146,10 @@ index 1b46e794e..75a0d6181 100644
  
  struct ssh;
 diff --git a/monitor_wrap.c b/monitor_wrap.c
-index af0252964..2b044f383 100644
+index a909950b5..d8f0469ee 100644
 --- a/monitor_wrap.c
 +++ b/monitor_wrap.c
-@@ -1112,13 +1112,15 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
+@@ -1115,13 +1115,15 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
  }
  
  int
@@ -3177,7 +3166,7 @@ index af0252964..2b044f383 100644
  
  	mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUSEROK, m);
  	mm_request_receive_expect(pmonitor->m_recvfd,
-@@ -1131,6 +1133,59 @@ mm_ssh_gssapi_userok(char *user)
+@@ -1134,6 +1136,59 @@ mm_ssh_gssapi_userok(char *user)
  	debug3_f("user %sauthenticated", authenticated ? "" : "not ");
  	return (authenticated);
  }
@@ -3254,7 +3243,7 @@ index 30585187c..07b207d1d 100644
  
  #ifdef USE_PAM
 diff --git a/readconf.c b/readconf.c
-index 7465216f3..992c78866 100644
+index e80db7527..a07669754 100644
 --- a/readconf.c
 +++ b/readconf.c
 @@ -57,6 +57,7 @@
@@ -3297,7 +3286,7 @@ index 7465216f3..992c78866 100644
  #endif
  #ifdef ENABLE_PKCS11
  	{ "pkcs11provider", oPKCS11Provider },
-@@ -1319,10 +1334,42 @@ parse_time:
+@@ -1328,10 +1343,42 @@ parse_time:
  		intptr = &options->gss_authentication;
  		goto parse_flag;
  
@@ -3340,7 +3329,7 @@ index 7465216f3..992c78866 100644
  	case oBatchMode:
  		intptr = &options->batch_mode;
  		goto parse_flag;
-@@ -2719,7 +2766,13 @@ initialize_options(Options * options)
+@@ -2731,7 +2778,13 @@ initialize_options(Options * options)
  	options->fwd_opts.streamlocal_bind_unlink = -1;
  	options->pubkey_authentication = -1;
  	options->gss_authentication = -1;
@@ -3354,7 +3343,7 @@ index 7465216f3..992c78866 100644
  	options->password_authentication = -1;
  	options->kbd_interactive_authentication = -1;
  	options->kbd_interactive_devices = NULL;
-@@ -2885,8 +2938,18 @@ fill_default_options(Options * options)
+@@ -2897,8 +2950,18 @@ fill_default_options(Options * options)
  		options->pubkey_authentication = SSH_PUBKEY_AUTH_ALL;
  	if (options->gss_authentication == -1)
  		options->gss_authentication = 0;
@@ -3373,7 +3362,7 @@ index 7465216f3..992c78866 100644
  	if (options->password_authentication == -1)
  		options->password_authentication = 1;
  	if (options->kbd_interactive_authentication == -1)
-@@ -3766,7 +3829,14 @@ dump_client_config(Options *o, const char *host)
+@@ -3777,7 +3840,14 @@ dump_client_config(Options *o, const char *host)
  	dump_cfg_fmtint(oGatewayPorts, o->fwd_opts.gateway_ports);
  #ifdef GSSAPI
  	dump_cfg_fmtint(oGssAuthentication, o->gss_authentication);
@@ -3389,7 +3378,7 @@ index 7465216f3..992c78866 100644
  	dump_cfg_fmtint(oHashKnownHosts, o->hash_known_hosts);
  	dump_cfg_fmtint(oHostbasedAuthentication, o->hostbased_authentication);
 diff --git a/readconf.h b/readconf.h
-index dbcb41725..8b0c98acf 100644
+index 3a7dfc1ff..7f2cbe9d0 100644
 --- a/readconf.h
 +++ b/readconf.h
 @@ -39,7 +39,13 @@ typedef struct {
@@ -3407,7 +3396,7 @@ index dbcb41725..8b0c98acf 100644
  						 * authentication. */
  	int     kbd_interactive_authentication; /* Try keyboard-interactive auth. */
 diff --git a/servconf.c b/servconf.c
-index e7819d59a..f28d19194 100644
+index bfb227a03..e30110d3d 100644
 --- a/servconf.c
 +++ b/servconf.c
 @@ -62,6 +62,7 @@
@@ -3418,7 +3407,7 @@ index e7819d59a..f28d19194 100644
  
  #define SSHD_CONFIG_BLOB_VERSION	1
  
-@@ -335,6 +336,10 @@ fill_default_server_options(ServerOptions *options)
+@@ -350,6 +351,10 @@ fill_default_server_options(ServerOptions *options)
  		options->log_facility = SYSLOG_FACILITY_AUTH;
  	if (options->log_level == SYSLOG_LEVEL_NOT_SET)
  		options->log_level = SYSLOG_LEVEL_INFO;
@@ -3429,7 +3418,7 @@ index e7819d59a..f28d19194 100644
  	if (options->permit_user_env == -1) {
  		options->permit_user_env = 0;
  		options->permit_user_env_allowlist = NULL;
-@@ -1435,6 +1440,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1484,6 +1489,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		intptr = &options->gss_authentication;
  		goto parse_flag;
  
@@ -3440,7 +3429,7 @@ index e7819d59a..f28d19194 100644
  	case sGSSAPICleanupCredentials:
  		intptr = &options->gss_cleanup_creds;
  		goto parse_flag;
-@@ -1446,6 +1455,22 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1495,6 +1504,22 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  	case sGSSAPIStrictAcceptorCheck:
  		intptr = &options->gss_strict_acceptor;
  		goto parse_flag;
@@ -3463,7 +3452,7 @@ index e7819d59a..f28d19194 100644
  #endif /* GSSAPI */
  
  	case sPasswordAuthentication:
-@@ -4217,7 +4242,10 @@ dump_config(ServerOptions *o)
+@@ -4347,7 +4372,10 @@ dump_config(ServerOptions *o)
  	dump_cfg_fmtint(sGSSAPIAuthentication, o->gss_authentication);
  	dump_cfg_fmtint(sGSSAPICleanupCredentials, o->gss_cleanup_creds);
  	dump_cfg_fmtint(sGSSAPIDelegateCredentials, o->gss_deleg_creds);
@@ -3475,10 +3464,10 @@ index e7819d59a..f28d19194 100644
  	dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
  	dump_cfg_fmtint(sKbdInteractiveAuthentication,
 diff --git a/servconf.h b/servconf.h
-index 3648e2be1..c6da79f53 100644
+index f31668549..e1e3cbf8d 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -316,14 +316,21 @@ SSHCONF_UNSUPPORTED_INT(kerberos_get_afs_token, KerberosGetAFSToken, SSHCFG_GLOB
+@@ -323,14 +323,21 @@ SSHCONF_UNSUPPORTED_INT(kerberos_get_afs_token, KerberosGetAFSToken, SSHCFG_GLOB
  #define SSHD_CONFIG_ENTRIES_GSS \
  SSHCONF_INTFLAG(gss_authentication, GSSAPIAuthentication, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH) \
  SSHCONF_INTFLAG(gss_cleanup_creds, GSSAPICleanupCredentials, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
@@ -3503,10 +3492,10 @@ index 3648e2be1..c6da79f53 100644
  
  #define SSHD_CONFIG_ENTRIES \
 diff --git a/session.c b/session.c
-index fc9c9d6f8..7b76f1f71 100644
+index 9125cbb83..2fbc1f735 100644
 --- a/session.c
 +++ b/session.c
-@@ -2642,13 +2642,19 @@ do_cleanup(struct ssh *ssh, Authctxt *authctxt)
+@@ -2647,13 +2647,19 @@ do_cleanup(struct ssh *ssh, Authctxt *authctxt)
  
  #ifdef KRB5
  	if (options.kerberos_ticket_cleanup &&
@@ -3529,7 +3518,7 @@ index fc9c9d6f8..7b76f1f71 100644
  
  	/* remove agent socket */
 diff --git a/ssh-gss.h b/ssh-gss.h
-index 7b14e74a8..8ec451926 100644
+index 3648c6d04..122830f39 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
 @@ -61,10 +61,36 @@
@@ -3569,19 +3558,20 @@ index 7b14e74a8..8ec451926 100644
  	void *data;
  } ssh_gssapi_ccache;
  
-@@ -72,8 +98,11 @@ typedef struct {
+@@ -72,9 +98,12 @@ typedef struct {
  	gss_buffer_desc displayname;
  	gss_buffer_desc exportedname;
  	gss_cred_id_t creds;
 +	gss_name_t name;
  	struct ssh_gssapi_mech_struct *mech;
  	ssh_gssapi_ccache store;
+ 	int userok;
 +	int used;
 +	int updated;
  } ssh_gssapi_client;
  
  typedef struct ssh_gssapi_mech_struct {
-@@ -84,6 +113,7 @@ typedef struct ssh_gssapi_mech_struct {
+@@ -85,6 +114,7 @@ typedef struct ssh_gssapi_mech_struct {
  	int (*userok) (ssh_gssapi_client *, char *);
  	int (*localname) (ssh_gssapi_client *, char **);
  	void (*storecreds) (ssh_gssapi_client *);
@@ -3589,7 +3579,7 @@ index 7b14e74a8..8ec451926 100644
  } ssh_gssapi_mech;
  
  typedef struct {
-@@ -94,10 +124,21 @@ typedef struct {
+@@ -95,10 +125,21 @@ typedef struct {
  	gss_OID		oid; /* client */
  	gss_cred_id_t	creds; /* server */
  	gss_name_t	client; /* server */
@@ -3612,7 +3602,7 @@ index 7b14e74a8..8ec451926 100644
  
  int  ssh_gssapi_check_oid(Gssctxt *, void *, size_t);
  void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t);
-@@ -108,6 +149,7 @@ OM_uint32 ssh_gssapi_test_oid_supported(OM_uint32 *, gss_OID, int *);
+@@ -109,6 +150,7 @@ OM_uint32 ssh_gssapi_test_oid_supported(OM_uint32 *, gss_OID, int *);
  
  struct sshbuf;
  int ssh_gssapi_get_buffer_desc(struct sshbuf *, gss_buffer_desc *);
@@ -3620,7 +3610,7 @@ index 7b14e74a8..8ec451926 100644
  
  OM_uint32 ssh_gssapi_import_name(Gssctxt *, const char *);
  OM_uint32 ssh_gssapi_init_ctx(Gssctxt *, int,
-@@ -122,17 +164,33 @@ void ssh_gssapi_delete_ctx(Gssctxt **);
+@@ -123,11 +165,21 @@ void ssh_gssapi_delete_ctx(Gssctxt **);
  OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t);
  void ssh_gssapi_buildmic(struct sshbuf *, const char *,
      const char *, const char *, const struct sshbuf *);
@@ -3644,8 +3634,9 @@ index 7b14e74a8..8ec451926 100644
  OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t);
  void ssh_gssapi_do_child(char ***, u_int *);
  void ssh_gssapi_cleanup_creds(void);
- void ssh_gssapi_storecreds(void);
+@@ -135,6 +187,12 @@ void ssh_gssapi_storecreds(void);
  const char *ssh_gssapi_displayname(void);
+ void ssh_gssapi_cleanup_global_client();
  
 +char *ssh_gssapi_server_mechanisms(void);
 +int ssh_gssapi_oid_table_ok(void);
@@ -3657,20 +3648,20 @@ index 7b14e74a8..8ec451926 100644
  
  #endif /* _SSH_GSS_H */
 diff --git a/ssh.1 b/ssh.1
-index 089bd348a..a61b0abfa 100644
+index 4930a51f5..9887b1392 100644
 --- a/ssh.1
 +++ b/ssh.1
-@@ -539,6 +539,8 @@ flag),
- (supported message integrity codes),
- .Ar kex
- (key exchange algorithms),
+@@ -544,6 +544,8 @@ flag
+ supported message integrity codes
+ .It Cm kex
+ key exchange algorithms
 +.Ar kex-gss
-+(GSSAPI key exchange algorithms),
- .Ar key
- (key types),
- .Ar key-ca-sign
++GSSAPI key exchange algorithms
+ .It Cm key
+ key types
+ .It Cm key-ca-sign
 diff --git a/ssh.c b/ssh.c
-index e9f99c433..b9a59ca43 100644
+index fe660efbd..6763e8934 100644
 --- a/ssh.c
 +++ b/ssh.c
 @@ -790,6 +790,9 @@ main(int ac, char **av)
@@ -3708,7 +3699,7 @@ index d9324c957..ca7c5853b 100644
  #   CheckHostIP no
  #   AddressFamily any
 diff --git a/ssh_config.5 b/ssh_config.5
-index bdaa49c81..04797a1e9 100644
+index e65bc1252..178f0f503 100644
 --- a/ssh_config.5
 +++ b/ssh_config.5
 @@ -1014,10 +1014,71 @@ The default is
@@ -3784,7 +3775,7 @@ index bdaa49c81..04797a1e9 100644
  Indicates that
  .Xr ssh 1
 diff --git a/sshconnect2.c b/sshconnect2.c
-index 0d4888402..5459caa0c 100644
+index 265ebfccc..f6af0152a 100644
 --- a/sshconnect2.c
 +++ b/sshconnect2.c
 @@ -223,6 +223,11 @@ ssh_kex2(struct ssh *ssh, char *host, struct sockaddr_storage *hostaddr,
@@ -3910,7 +3901,7 @@ index 0d4888402..5459caa0c 100644
  	{"gssapi-with-mic",
  		userauth_gssapi,
  		userauth_gssapi_cleanup,
-@@ -760,12 +837,32 @@ userauth_gssapi(struct ssh *ssh)
+@@ -766,12 +843,32 @@ userauth_gssapi(struct ssh *ssh)
  	OM_uint32 min;
  	int r, ok = 0;
  	gss_OID mech = NULL;
@@ -3944,7 +3935,7 @@ index 0d4888402..5459caa0c 100644
  
  	/* Check to see whether the mechanism is usable before we offer it */
  	while (authctxt->mech_tried < authctxt->gss_supported_mechs->count &&
-@@ -774,13 +871,15 @@ userauth_gssapi(struct ssh *ssh)
+@@ -780,13 +877,15 @@ userauth_gssapi(struct ssh *ssh)
  		    elements[authctxt->mech_tried];
  		/* My DER encoding requires length<128 */
  		if (mech->length < 128 && ssh_gssapi_check_mechanism(&gssctxt,
@@ -3961,7 +3952,7 @@ index 0d4888402..5459caa0c 100644
  	if (!ok || mech == NULL)
  		return 0;
  
-@@ -1014,6 +1113,55 @@ input_gssapi_error(int type, uint32_t plen, struct ssh *ssh)
+@@ -1020,6 +1119,55 @@ input_gssapi_error(int type, uint32_t plen, struct ssh *ssh)
  	free(lang);
  	return r;
  }
@@ -4018,7 +4009,7 @@ index 0d4888402..5459caa0c 100644
  
  static int
 diff --git a/sshd-auth.c b/sshd-auth.c
-index 14109151c..079063f47 100644
+index f068d6c67..c7c4a88f6 100644
 --- a/sshd-auth.c
 +++ b/sshd-auth.c
 @@ -665,7 +665,7 @@ main(int ac, char **av)
@@ -4030,7 +4021,7 @@ index 14109151c..079063f47 100644
  		fatal("internal error: received no hostkeys");
  
  	/* Ensure that umask disallows at least group and world write */
-@@ -784,6 +784,48 @@ do_ssh2_kex(struct ssh *ssh)
+@@ -786,6 +786,48 @@ do_ssh2_kex(struct ssh *ssh)
  
  	free(hkalgs);
  
@@ -4079,7 +4070,7 @@ index 14109151c..079063f47 100644
  	if ((r = kex_exchange_identification(ssh, -1,
  	    options.version_addendum)) != 0)
  		sshpkt_fatal(ssh, r, "banner exchange");
-@@ -807,8 +849,18 @@ do_ssh2_kex(struct ssh *ssh)
+@@ -810,8 +852,18 @@ do_ssh2_kex(struct ssh *ssh)
  	kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
  	kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
  	kex->kex[KEX_ECDH_SHA2] = kex_gen_server;
@@ -4101,10 +4092,10 @@ index 14109151c..079063f47 100644
  	kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
  	kex->kex[KEX_KEM_MLKEM768X25519_SHA256] = kex_gen_server;
 diff --git a/sshd-session.c b/sshd-session.c
-index 6e9b28dec..cf6709f46 100644
+index c671c782d..539c0312a 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -565,8 +565,8 @@ notify_hostkeys(struct ssh *ssh)
+@@ -551,8 +551,8 @@ notify_hostkeys(struct ssh *ssh)
  	}
  	debug3_f("sent %u hostkeys", nkeys);
  	if (nkeys == 0)
@@ -4115,7 +4106,7 @@ index 6e9b28dec..cf6709f46 100644
  		sshpkt_fatal(ssh, r, "%s: send", __func__);
  	sshbuf_free(buf);
  }
-@@ -1108,8 +1108,9 @@ main(int ac, char **av)
+@@ -1094,8 +1094,9 @@ main(int ac, char **av)
  			break;
  		}
  	}
@@ -4128,10 +4119,10 @@ index 6e9b28dec..cf6709f46 100644
  	/* Ensure that umask disallows at least group and world write */
  	new_umask = umask(0077) | 0022;
 diff --git a/sshd.c b/sshd.c
-index 7d1466d97..f66e1f86f 100644
+index da2aba936..32019a44f 100644
 --- a/sshd.c
 +++ b/sshd.c
-@@ -1669,7 +1669,8 @@ main(int ac, char **av)
+@@ -1702,7 +1702,8 @@ main(int ac, char **av)
  		free(fp);
  	}
  	accumulate_host_timing_secret(cfg, NULL);
@@ -4155,10 +4146,10 @@ index f626d5801..404aa1bbb 100644
  # Set this to 'yes' to enable PAM authentication, account processing,
  # and session processing. If this is enabled, PAM authentication will
 diff --git a/sshd_config.5 b/sshd_config.5
-index e85cca6eb..625e6fdec 100644
+index 4c1b20df8..77f6340fb 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -760,9 +760,19 @@ on logout.
+@@ -786,9 +786,19 @@ on logout.
  The default is
  .Cm yes .
  .It Cm GSSAPIDelegateCredentials
@@ -4180,7 +4171,7 @@ index e85cca6eb..625e6fdec 100644
  .It Cm GSSAPIStrictAcceptorCheck
  Determines whether to be strict about the identity of the GSSAPI acceptor
  a client authenticates against.
-@@ -778,6 +788,35 @@ This facility is provided to assist with operation on multi homed machines.
+@@ -804,6 +814,35 @@ This facility is provided to assist with operation on multi homed machines.
  The default is
  .Cm yes .
  This option may not be effective in Windows Active Directory environments.
@@ -4217,10 +4208,10 @@ index e85cca6eb..625e6fdec 100644
  Specifies the signature algorithms that will be accepted for hostbased
  authentication as a list of comma-separated patterns.
 diff --git a/sshkey.c b/sshkey.c
-index a590529a0..7d1401a8f 100644
+index dddfeb448..dd5171a2c 100644
 --- a/sshkey.c
 +++ b/sshkey.c
-@@ -115,6 +115,75 @@ extern const struct sshkey_impl sshkey_rsa_sha512_impl;
+@@ -117,6 +117,75 @@ extern const struct sshkey_impl sshkey_rsa_sha512_impl;
  extern const struct sshkey_impl sshkey_rsa_sha512_cert_impl;
  #endif /* WITH_OPENSSL */
  
@@ -4296,7 +4287,7 @@ index a590529a0..7d1401a8f 100644
  const struct sshkey_impl * const keyimpls[] = {
  	&sshkey_ed25519_impl,
  	&sshkey_ed25519_cert_impl,
-@@ -146,6 +215,7 @@ const struct sshkey_impl * const keyimpls[] = {
+@@ -148,6 +217,7 @@ const struct sshkey_impl * const keyimpls[] = {
  	&sshkey_rsa_sha512_impl,
  	&sshkey_rsa_sha512_cert_impl,
  #endif /* WITH_OPENSSL */
@@ -4304,7 +4295,7 @@ index a590529a0..7d1401a8f 100644
  	NULL
  };
  
-@@ -327,7 +397,7 @@ sshkey_alg_list(int certs_only, int plain_only, int include_sigonly, char sep)
+@@ -329,7 +399,7 @@ sshkey_alg_list(int certs_only, int plain_only, int include_sigonly, char sep)
  
  	for (i = 0; keyimpls[i] != NULL; i++) {
  		impl = keyimpls[i];
@@ -4314,7 +4305,7 @@ index a590529a0..7d1401a8f 100644
  		if (!include_sigonly && impl->sigonly)
  			continue;
 diff --git a/sshkey.h b/sshkey.h
-index e4f84f16f..3e738f42c 100644
+index 43dc94815..6a6e1908c 100644
 --- a/sshkey.h
 +++ b/sshkey.h
 @@ -63,6 +63,7 @@ enum sshkey_types {
@@ -4326,5 +4317,5 @@ index e4f84f16f..3e738f42c 100644
  };
  
 -- 
-2.55.0
+2.56.0
 

diff --git a/0014-openssh-6.6p1-force_krb.patch b/0014-openssh-6.6p1-force_krb.patch
index fdd0c85..a578706 100644
--- a/0014-openssh-6.6p1-force_krb.patch
+++ b/0014-openssh-6.6p1-force_krb.patch
@@ -1,4 +1,4 @@
-From 5d1debdaee7b6dc51c5f10530b4698a7a2f1bb80 Mon Sep 17 00:00:00 2001
+From 86e6acc12639c293fb98f1949348a1d6a7f77702 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 14/53] openssh-6.6p1-force_krb
@@ -218,10 +218,10 @@ index be401fe0e..c26174928 100644
  /* This writes out any forwarded credentials from the structure populated
   * during userauth. Called after we have setuid to the user */
 diff --git a/session.c b/session.c
-index 7b76f1f71..b4db64ea4 100644
+index 2fbc1f735..27e09cccd 100644
 --- a/session.c
 +++ b/session.c
-@@ -643,6 +643,29 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -648,6 +648,29 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  		command = auth_opts->force_command;
  		forced = "(key-option)";
  	}
@@ -252,7 +252,7 @@ index 7b76f1f71..b4db64ea4 100644
  	if (forced != NULL) {
  		s->forced = 1;
 diff --git a/ssh-gss.h b/ssh-gss.h
-index 8ec451926..db34d77f4 100644
+index 122830f39..7df47cae2 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
 @@ -49,6 +49,10 @@
@@ -267,7 +267,7 @@ index 8ec451926..db34d77f4 100644
  
  /* draft-ietf-secsh-gsskeyex-06 */
 diff --git a/sshd.8 b/sshd.8
-index 24e5639a3..8ef358cd5 100644
+index 4bfbeaf63..d8a4b8090 100644
 --- a/sshd.8
 +++ b/sshd.8
 @@ -287,6 +287,7 @@ Finally, the server and the client enter an authentication dialog.
@@ -292,5 +292,5 @@ index 24e5639a3..8ef358cd5 100644
  This directory is the default location for all user-specific configuration
  and authentication information.
 -- 
-2.55.0
+2.56.0
 

diff --git a/0015-openssh-7.7p1-gssapi-new-unique.patch b/0015-openssh-7.7p1-gssapi-new-unique.patch
index 55ebe93..91541c4 100644
--- a/0015-openssh-7.7p1-gssapi-new-unique.patch
+++ b/0015-openssh-7.7p1-gssapi-new-unique.patch
@@ -1,4 +1,4 @@
-From 9452875760b99fb538463f291fcedee75dee4a38 Mon Sep 17 00:00:00 2001
+From 573be6986398ac634329de8209377051d5d780a8 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 15/53] openssh-7.7p1-gssapi-new-unique
@@ -7,14 +7,14 @@ Subject: [PATCH 15/53] openssh-7.7p1-gssapi-new-unique
  auth-krb5.c     | 264 ++++++++++++++++++++++++++++++++++++++++++------
  auth.h          |   3 +-
  gss-serv-krb5.c |  42 +++-----
- gss-serv.c      |  12 +--
+ gss-serv.c      |  14 +--
  servconf.c      |   5 +
  servconf.h      |   2 +
  session.c       |   5 +-
  ssh-gss.h       |   4 +-
  sshd-session.c  |   2 +-
  sshd_config.5   |   8 ++
- 10 files changed, 276 insertions(+), 71 deletions(-)
+ 10 files changed, 277 insertions(+), 72 deletions(-)
 
 diff --git a/auth-krb5.c b/auth-krb5.c
 index 3c6dc0622..863110910 100644
@@ -341,10 +341,10 @@ index 3c6dc0622..863110910 100644
  #endif /* !HEIMDAL */
  #endif /* KRB5 */
 diff --git a/auth.h b/auth.h
-index efe819323..2a19e2b34 100644
+index ca6f507cc..e1ce9d7c0 100644
 --- a/auth.h
 +++ b/auth.h
-@@ -85,6 +85,7 @@ struct Authctxt {
+@@ -87,6 +87,7 @@ struct Authctxt {
  	krb5_principal	 krb5_user;
  	char		*krb5_ticket_file;
  	char		*krb5_ccname;
@@ -352,7 +352,7 @@ index efe819323..2a19e2b34 100644
  #endif
  	struct sshbuf	*loginmsg;
  
-@@ -244,7 +245,7 @@ FILE	*auth_openprincipals(const char *, struct passwd *, int);
+@@ -246,7 +247,7 @@ FILE	*auth_openprincipals(const char *, struct passwd *, int);
  int	 sys_auth_passwd(struct ssh *, const char *);
  
  #if defined(KRB5) && !defined(HEIMDAL)
@@ -477,10 +477,10 @@ index c26174928..415fb1893 100644
  
  int
 diff --git a/gss-serv.c b/gss-serv.c
-index 8b4fa9cfe..6eb7d2163 100644
+index bf015aef7..5bc31289e 100644
 --- a/gss-serv.c
 +++ b/gss-serv.c
-@@ -415,18 +415,20 @@ ssh_gssapi_cleanup_creds(void)
+@@ -416,23 +416,25 @@ ssh_gssapi_cleanup_creds(void)
  }
  
  /* As user */
@@ -488,6 +488,12 @@ index 8b4fa9cfe..6eb7d2163 100644
 +int
  ssh_gssapi_storecreds(void)
  {
+ 	if (!gssapi_client.userok) {
+ 		debug_f("GSSAPI client was not authorized, doing nothing");
+-		return;
++		return 0;
+ 	}
+ 
  	if (options.gss_deleg_creds == 0) {
  		debug_f("delegate credential is disabled, doing nothing");
 -		return;
@@ -504,7 +510,7 @@ index 8b4fa9cfe..6eb7d2163 100644
  }
  
  /* This allows GSSAPI methods to do things to the child's environment based
-@@ -506,9 +508,7 @@ ssh_gssapi_rekey_creds(void) {
+@@ -516,9 +518,7 @@ ssh_gssapi_rekey_creds(void) {
  	char *envstr;
  #endif
  
@@ -516,10 +522,10 @@ index 8b4fa9cfe..6eb7d2163 100644
  
  	ok = mm_ssh_gssapi_update_creds(&gssapi_client.store);
 diff --git a/servconf.c b/servconf.c
-index f28d19194..ae18d56fd 100644
+index e30110d3d..fff2e1480 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -1435,6 +1435,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1484,6 +1484,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  #endif /* USE_AFS */
  #endif /* KRB5 */
  
@@ -530,7 +536,7 @@ index f28d19194..ae18d56fd 100644
  #ifdef GSSAPI
  	case sGSSAPIAuthentication:
  		intptr = &options->gss_authentication;
-@@ -4237,6 +4241,7 @@ dump_config(ServerOptions *o)
+@@ -4367,6 +4371,7 @@ dump_config(ServerOptions *o)
  # ifdef USE_AFS
  	dump_cfg_fmtint(sKerberosGetAFSToken, o->kerberos_get_afs_token);
  # endif
@@ -539,10 +545,10 @@ index f28d19194..ae18d56fd 100644
  #ifdef GSSAPI
  	dump_cfg_fmtint(sGSSAPIAuthentication, o->gss_authentication);
 diff --git a/servconf.h b/servconf.h
-index c6da79f53..5f5672082 100644
+index e1e3cbf8d..74ac5282d 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -303,12 +303,14 @@ SSHCONF_UNSUPPORTED_INT(kerberos_get_afs_token, KerberosGetAFSToken, SSHCFG_GLOB
+@@ -310,12 +310,14 @@ SSHCONF_UNSUPPORTED_INT(kerberos_get_afs_token, KerberosGetAFSToken, SSHCFG_GLOB
  SSHCONF_INTFLAG(kerberos_authentication, KerberosAuthentication, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH) \
  SSHCONF_INTFLAG(kerberos_or_local_passwd, KerberosOrLocalPasswd, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(kerberos_ticket_cleanup, KerberosTicketCleanup, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
@@ -558,10 +564,10 @@ index c6da79f53..5f5672082 100644
  #endif /* KRB5 */
  
 diff --git a/session.c b/session.c
-index b4db64ea4..c2cdd6c4f 100644
+index 27e09cccd..84a7d7a4f 100644
 --- a/session.c
 +++ b/session.c
-@@ -988,7 +988,8 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
+@@ -993,7 +993,8 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
  	/* Allow any GSSAPI methods that we've used to alter
  	 * the child's environment as they see fit
  	 */
@@ -571,7 +577,7 @@ index b4db64ea4..c2cdd6c4f 100644
  #endif
  
  	/* Set basic environment. */
-@@ -1070,7 +1071,7 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
+@@ -1075,7 +1076,7 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
  	}
  #endif
  #ifdef KRB5
@@ -581,10 +587,10 @@ index b4db64ea4..c2cdd6c4f 100644
  		    s->authctxt->krb5_ccname);
  #endif
 diff --git a/ssh-gss.h b/ssh-gss.h
-index db34d77f4..a894e23c9 100644
+index 7df47cae2..9a05cdda1 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
-@@ -116,7 +116,7 @@ typedef struct ssh_gssapi_mech_struct {
+@@ -117,7 +117,7 @@ typedef struct ssh_gssapi_mech_struct {
  	int (*dochild) (ssh_gssapi_client *);
  	int (*userok) (ssh_gssapi_client *, char *);
  	int (*localname) (ssh_gssapi_client *, char **);
@@ -593,20 +599,20 @@ index db34d77f4..a894e23c9 100644
  	int (*updatecreds) (ssh_gssapi_ccache *, ssh_gssapi_client *);
  } ssh_gssapi_mech;
  
-@@ -186,7 +186,7 @@ int ssh_gssapi_userok(char *name, struct passwd *, int kex);
+@@ -187,7 +187,7 @@ int ssh_gssapi_userok(char *name, struct passwd *, int kex);
  OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t);
  void ssh_gssapi_do_child(char ***, u_int *);
  void ssh_gssapi_cleanup_creds(void);
 -void ssh_gssapi_storecreds(void);
 +int ssh_gssapi_storecreds(void);
  const char *ssh_gssapi_displayname(void);
+ void ssh_gssapi_cleanup_global_client();
  
- char *ssh_gssapi_server_mechanisms(void);
 diff --git a/sshd-session.c b/sshd-session.c
-index cf6709f46..8a3121d01 100644
+index 539c0312a..ea812ae72 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -1298,7 +1298,7 @@ main(int ac, char **av)
+@@ -1285,7 +1285,7 @@ main(int ac, char **av)
  #ifdef GSSAPI
  	if (options.gss_authentication) {
  		temporarily_use_uid(authctxt->pw);
@@ -616,10 +622,10 @@ index cf6709f46..8a3121d01 100644
  	}
  #endif
 diff --git a/sshd_config.5 b/sshd_config.5
-index 625e6fdec..08a304cdc 100644
+index 77f6340fb..cb4c74899 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -1074,6 +1074,14 @@ Specifies whether to automatically destroy the user's ticket cache
+@@ -1100,6 +1100,14 @@ Specifies whether to automatically destroy the user's ticket cache
  file on logout.
  The default is
  .Cm yes .
@@ -635,5 +641,5 @@ index 625e6fdec..08a304cdc 100644
  Specifies the permitted KEX (Key Exchange) algorithms that the server will
  offer to clients.
 -- 
-2.55.0
+2.56.0
 

diff --git a/0016-openssh-7.2p2-k5login_directory.patch b/0016-openssh-7.2p2-k5login_directory.patch
index 2cd743e..0bd48cd 100644
--- a/0016-openssh-7.2p2-k5login_directory.patch
+++ b/0016-openssh-7.2p2-k5login_directory.patch
@@ -1,4 +1,4 @@
-From 76a46dc287ab78071242bbf8f31dd1dd2f805970 Mon Sep 17 00:00:00 2001
+From 5073b970e45212e70e89106e4d3538ee58d2bcd4 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 16/53] openssh-7.2p2-k5login_directory
@@ -38,10 +38,10 @@ index 863110910..996b19738 100644
  #endif /* !HEIMDAL */
  #endif /* KRB5 */
 diff --git a/auth.h b/auth.h
-index 2a19e2b34..9dd25f494 100644
+index e1ce9d7c0..2e0051899 100644
 --- a/auth.h
 +++ b/auth.h
-@@ -246,6 +246,8 @@ int	 sys_auth_passwd(struct ssh *, const char *);
+@@ -248,6 +248,8 @@ int	 sys_auth_passwd(struct ssh *, const char *);
  
  #if defined(KRB5) && !defined(HEIMDAL)
  krb5_error_code ssh_krb5_cc_new_unique(krb5_context, krb5_ccache *, int *);
@@ -84,7 +84,7 @@ index 415fb1893..7df31c6af 100644
  }
  
 diff --git a/sshd.8 b/sshd.8
-index 8ef358cd5..ae22a9ea4 100644
+index d8a4b8090..19dfefb68 100644
 --- a/sshd.8
 +++ b/sshd.8
 @@ -884,6 +884,10 @@ rlogin/rsh.
@@ -99,5 +99,5 @@ index 8ef358cd5..ae22a9ea4 100644
  .It Pa ~/.ssh/
  This directory is the default location for all user-specific configuration
 -- 
-2.55.0
+2.56.0
 

diff --git a/0017-openssh-6.6p1-kuserok.patch b/0017-openssh-6.6p1-kuserok.patch
index f84381d..f55884a 100644
--- a/0017-openssh-6.6p1-kuserok.patch
+++ b/0017-openssh-6.6p1-kuserok.patch
@@ -1,4 +1,4 @@
-From 4672febd5ff5082fe25b18069485f05491238dc2 Mon Sep 17 00:00:00 2001
+From 30a14b0785de651321467eb2c7307c8833c1cd66 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 17/53] openssh-6.6p1-kuserok
@@ -189,10 +189,10 @@ index 7df31c6af..6f5826ce8 100644
  	if ((fp = fopen(file, "r")) == NULL) {
  		int saved_errno = errno;
 diff --git a/servconf.c b/servconf.c
-index ae18d56fd..5de03f3bf 100644
+index fff2e1480..ee30f0426 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -2229,6 +2229,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -2302,6 +2302,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		}
  		break;
  
@@ -203,7 +203,7 @@ index ae18d56fd..5de03f3bf 100644
  	case sMatch:
  		if (cmdline)
  			fatal("Match directive not supported as a command-line "
-@@ -4242,6 +4246,7 @@ dump_config(ServerOptions *o)
+@@ -4372,6 +4376,7 @@ dump_config(ServerOptions *o)
  	dump_cfg_fmtint(sKerberosGetAFSToken, o->kerberos_get_afs_token);
  # endif
  	dump_cfg_fmtint(sKerberosUniqueCCache, o->kerberos_unique_ccache);
@@ -212,10 +212,10 @@ index ae18d56fd..5de03f3bf 100644
  #ifdef GSSAPI
  	dump_cfg_fmtint(sGSSAPIAuthentication, o->gss_authentication);
 diff --git a/servconf.h b/servconf.h
-index 5f5672082..7c003b8c5 100644
+index 74ac5282d..e9089ca0a 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -304,6 +304,7 @@ SSHCONF_INTFLAG(kerberos_authentication, KerberosAuthentication, SSHCFG_ALL, 0,
+@@ -311,6 +311,7 @@ SSHCONF_INTFLAG(kerberos_authentication, KerberosAuthentication, SSHCFG_ALL, 0,
  SSHCONF_INTFLAG(kerberos_or_local_passwd, KerberosOrLocalPasswd, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(kerberos_ticket_cleanup, KerberosTicketCleanup, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(kerberos_unique_ccache, KerberosUniqueCCache, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
@@ -223,7 +223,7 @@ index 5f5672082..7c003b8c5 100644
  SSHD_CONFIG_KRB5_AFS
  #else /* KRB5 */
  #define SSHD_CONFIG_ENTRIES_KRB5 \
-@@ -311,6 +312,7 @@ SSHCONF_UNSUPPORTED_INT(kerberos_authentication, KerberosAuthentication, SSHCFG_
+@@ -318,6 +319,7 @@ SSHCONF_UNSUPPORTED_INT(kerberos_authentication, KerberosAuthentication, SSHCFG_
  SSHCONF_UNSUPPORTED_INT(kerberos_or_local_passwd, KerberosOrLocalPasswd, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(kerberos_ticket_cleanup, KerberosTicketCleanup, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(kerberos_unique_ccache, KerberosUniqueCCache, SSHCFG_GLOBAL) \
@@ -244,10 +244,10 @@ index 404aa1bbb..76279d795 100644
  # GSSAPI options
  #GSSAPIAuthentication no
 diff --git a/sshd_config.5 b/sshd_config.5
-index 08a304cdc..0077ee096 100644
+index cb4c74899..a700cfd3f 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -1082,6 +1082,10 @@ The default value
+@@ -1108,6 +1108,10 @@ The default value
  .Cm no
  can lead to overwriting previous tickets by subseqent connections to the same
  user account.
@@ -258,7 +258,7 @@ index 08a304cdc..0077ee096 100644
  .It Cm KexAlgorithms
  Specifies the permitted KEX (Key Exchange) algorithms that the server will
  offer to clients.
-@@ -1398,6 +1402,7 @@ Available keywords are
+@@ -1424,6 +1428,7 @@ Available keywords are
  .Cm IPQoS ,
  .Cm KbdInteractiveAuthentication ,
  .Cm KerberosAuthentication ,
@@ -267,5 +267,5 @@ index 08a304cdc..0077ee096 100644
  .Cm MaxAuthTries ,
  .Cm MaxSessions ,
 -- 
-2.55.0
+2.56.0
 

diff --git a/0018-openssh-6.4p1-fromto-remote.patch b/0018-openssh-6.4p1-fromto-remote.patch
index 204c575..a3f2629 100644
--- a/0018-openssh-6.4p1-fromto-remote.patch
+++ b/0018-openssh-6.4p1-fromto-remote.patch
@@ -1,4 +1,4 @@
-From e6388dfdb9cc60c505b7d2765ec0688de0820abb Mon Sep 17 00:00:00 2001
+From 3eba13cb9f6e5f2d099bd9b98d393f247b2b640c Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 18/53] openssh-6.4p1-fromto-remote
@@ -9,10 +9,10 @@ Subject: [PATCH 18/53] openssh-6.4p1-fromto-remote
  1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/scp.c b/scp.c
-index 28ac7a29d..4821514ba 100644
+index 54ada858f..241ec32f9 100644
 --- a/scp.c
 +++ b/scp.c
-@@ -1143,7 +1143,10 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
+@@ -1145,7 +1145,10 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
  			addargs(&alist, "%s", ssh_program);
  			addargs(&alist, "-x");
  			addargs(&alist, "-oClearAllForwardings=yes");
@@ -25,5 +25,5 @@ index 28ac7a29d..4821514ba 100644
  				addargs(&alist, "%s",
  				    remote_remote_args.list[j]);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0019-openssh-6.6.1p1-log-in-chroot.patch b/0019-openssh-6.6.1p1-log-in-chroot.patch
index 2538ec2..37f33dd 100644
--- a/0019-openssh-6.6.1p1-log-in-chroot.patch
+++ b/0019-openssh-6.6.1p1-log-in-chroot.patch
@@ -1,4 +1,4 @@
-From 2316543bf85035762d9aadf200067fcaf2d0e338 Mon Sep 17 00:00:00 2001
+From 100c5fe6e0a7e838b8c4793279dc18aa6d19074c Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 19/53] openssh-6.6.1p1-log-in-chroot
@@ -57,7 +57,7 @@ index 8e8dfc23f..70048a8af 100644
  int      log_change_level(LogLevel);
  int      log_is_on_stderr(void);
 diff --git a/monitor.c b/monitor.c
-index fa477899e..14cdccf2f 100644
+index 98f47eaef..9d562012d 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -2014,9 +2014,22 @@ monitor_init(void)
@@ -99,7 +99,7 @@ index 75a0d6181..f4721c472 100644
  struct Authctxt;
  void monitor_child_preauth(struct ssh *, struct monitor *);
 diff --git a/session.c b/session.c
-index c2cdd6c4f..572487b4a 100644
+index 84a7d7a4f..105995f25 100644
 --- a/session.c
 +++ b/session.c
 @@ -162,6 +162,7 @@ login_cap_t *lc;
@@ -110,7 +110,7 @@ index c2cdd6c4f..572487b4a 100644
  
  /* File containing userauth info, if ExposeAuthInfo set */
  static char *auth_info_file = NULL;
-@@ -633,6 +634,7 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -638,6 +639,7 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  	int ret;
  	const char *forced = NULL, *tty = NULL;
  	char session_type[1024];
@@ -118,7 +118,7 @@ index c2cdd6c4f..572487b4a 100644
  
  	if (options.adm_forced_command) {
  		original_command = command;
-@@ -692,6 +694,10 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -697,6 +699,10 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  			tty += 5;
  	}
  
@@ -129,7 +129,7 @@ index c2cdd6c4f..572487b4a 100644
  	verbose("Starting session: %s%s%s for %s from %.200s port %d id %d",
  	    session_type,
  	    tty == NULL ? "" : " on ",
-@@ -1476,14 +1482,6 @@ child_close_fds(struct ssh *ssh)
+@@ -1481,14 +1487,6 @@ child_close_fds(struct ssh *ssh)
  
  	/* Stop directing logs to a high-numbered fd before we close it */
  	log_redirect_stderr_to(NULL);
@@ -144,7 +144,7 @@ index c2cdd6c4f..572487b4a 100644
  }
  
  /*
-@@ -1616,8 +1614,6 @@ do_child(struct ssh *ssh, Session *s, const char *command)
+@@ -1621,8 +1619,6 @@ do_child(struct ssh *ssh, Session *s, const char *command)
  			exit(1);
  	}
  
@@ -153,7 +153,7 @@ index c2cdd6c4f..572487b4a 100644
  	do_rc_files(ssh, s, shell);
  
  	/* restore SIGPIPE for child */
-@@ -1646,9 +1642,17 @@ do_child(struct ssh *ssh, Session *s, const char *command)
+@@ -1651,9 +1647,17 @@ do_child(struct ssh *ssh, Session *s, const char *command)
  #ifdef WITH_SELINUX
  		ssh_selinux_change_context("sftpd_t");
  #endif
@@ -226,19 +226,19 @@ index 2bde8bb7f..ddf1a3968 100644
 +int	sftp_server_main(int, char **, struct passwd *, int);
  void	sftp_server_cleanup_exit(int) __attribute__((noreturn));
 diff --git a/sshd-session.c b/sshd-session.c
-index 8a3121d01..8a06616fd 100644
+index ea812ae72..7ecefff77 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -387,7 +387,7 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
- #endif
- 
+@@ -372,7 +372,7 @@ static void
+ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
+ {
  	/* New socket pair */
 -	monitor_reinit(pmonitor);
 +	monitor_reinit(pmonitor, options.chroot_directory);
  
  	pmonitor->m_pid = fork();
  	if (pmonitor->m_pid == -1)
-@@ -406,6 +406,11 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
+@@ -391,6 +391,11 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
  
  	close(pmonitor->m_sendfd);
  	pmonitor->m_sendfd = -1;
@@ -251,5 +251,5 @@ index 8a3121d01..8a06616fd 100644
  	/* Demote the private keys to public keys. */
  	demote_sensitive_data();
 -- 
-2.55.0
+2.56.0
 

diff --git a/0020-openssh-6.6.1p1-scp-non-existing-directory.patch b/0020-openssh-6.6.1p1-scp-non-existing-directory.patch
index 32d4b60..54e9ddd 100644
--- a/0020-openssh-6.6.1p1-scp-non-existing-directory.patch
+++ b/0020-openssh-6.6.1p1-scp-non-existing-directory.patch
@@ -1,4 +1,4 @@
-From cf8d9d0f602ac23fa35e4f8b638a0494564d7dc4 Mon Sep 17 00:00:00 2001
+From 26e77ff2e0a12b290bf92a2bbbd94998155bdae8 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 20/53] openssh-6.6.1p1-scp-non-existing-directory
@@ -9,10 +9,10 @@ Subject: [PATCH 20/53] openssh-6.6.1p1-scp-non-existing-directory
  1 file changed, 4 insertions(+)
 
 diff --git a/scp.c b/scp.c
-index 4821514ba..fca4393f3 100644
+index 241ec32f9..8408e61ef 100644
 --- a/scp.c
 +++ b/scp.c
-@@ -1871,6 +1871,10 @@ sink(int argc, char **argv, const char *src)
+@@ -1875,6 +1875,10 @@ sink(int argc, char **argv, const char *src)
  			free(vect[0]);
  			continue;
  		}
@@ -24,5 +24,5 @@ index 4821514ba..fca4393f3 100644
  		mode |= S_IWUSR;
  		if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) == -1) {
 -- 
-2.55.0
+2.56.0
 

diff --git a/0021-openssh-6.6p1-GSSAPIEnablek5users.patch b/0021-openssh-6.6p1-GSSAPIEnablek5users.patch
index 96eeff4..53e429a 100644
--- a/0021-openssh-6.6p1-GSSAPIEnablek5users.patch
+++ b/0021-openssh-6.6p1-GSSAPIEnablek5users.patch
@@ -1,4 +1,4 @@
-From dd1871972173c9f4836c4d8096411981d291ff85 Mon Sep 17 00:00:00 2001
+From d112cb6d64b91e564dd965fdbd8fdb6b7404bdbc Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 21/53] openssh-6.6p1-GSSAPIEnablek5users
@@ -32,10 +32,10 @@ index 6f5826ce8..723509409 100644
                                          k5login_exists);
  	}
 diff --git a/servconf.c b/servconf.c
-index 5de03f3bf..3dbfccea8 100644
+index ee30f0426..0cfc2f3d8 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -2233,6 +2233,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -2306,6 +2306,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		intptr = &options->use_kuserok;
  		goto parse_flag;
  
@@ -46,7 +46,7 @@ index 5de03f3bf..3dbfccea8 100644
  	case sMatch:
  		if (cmdline)
  			fatal("Match directive not supported as a command-line "
-@@ -4247,6 +4251,7 @@ dump_config(ServerOptions *o)
+@@ -4377,6 +4381,7 @@ dump_config(ServerOptions *o)
  # endif
  	dump_cfg_fmtint(sKerberosUniqueCCache, o->kerberos_unique_ccache);
  	dump_cfg_fmtint(sKerberosUseKuserok, o->use_kuserok);
@@ -55,10 +55,10 @@ index 5de03f3bf..3dbfccea8 100644
  #ifdef GSSAPI
  	dump_cfg_fmtint(sGSSAPIAuthentication, o->gss_authentication);
 diff --git a/servconf.h b/servconf.h
-index 7c003b8c5..c55b64c73 100644
+index e9089ca0a..f6d1ecf09 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -325,7 +325,8 @@ SSHCONF_INTFLAG(gss_deleg_creds, GSSAPIDelegateCredentials, SSHCFG_GLOBAL, 1, SS
+@@ -332,7 +332,8 @@ SSHCONF_INTFLAG(gss_deleg_creds, GSSAPIDelegateCredentials, SSHCFG_GLOBAL, 1, SS
  SSHCONF_INTFLAG(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
@@ -68,7 +68,7 @@ index 7c003b8c5..c55b64c73 100644
  #else /* GSSAPI */
  #define SSHD_CONFIG_ENTRIES_GSS \
  SSHCONF_UNSUPPORTED_INT(gss_authentication, GSSAPIAuthentication, SSHCFG_ALL) \
-@@ -334,7 +335,8 @@ SSHCONF_UNSUPPORTED_INT(gss_deleg_creds, GSSAPIDelegateCredentials, SSHCFG_GLOBA
+@@ -341,7 +342,8 @@ SSHCONF_UNSUPPORTED_INT(gss_deleg_creds, GSSAPIDelegateCredentials, SSHCFG_GLOBA
  SSHCONF_UNSUPPORTED_INT(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL) \
@@ -91,5 +91,5 @@ index 76279d795..d38d899a6 100644
  # Set this to 'yes' to enable PAM authentication, account processing,
  # and session processing. If this is enabled, PAM authentication will
 -- 
-2.55.0
+2.56.0
 

diff --git a/0022-openssh-6.8p1-sshdT-output.patch b/0022-openssh-6.8p1-sshdT-output.patch
index acfe3f8..27777a7 100644
--- a/0022-openssh-6.8p1-sshdT-output.patch
+++ b/0022-openssh-6.8p1-sshdT-output.patch
@@ -1,4 +1,4 @@
-From c5cc166ff9eeba6b346022aa1ee0e4d78a2e1fdd Mon Sep 17 00:00:00 2001
+From 8d26ab37e23e7a2aa93d9068140060e620ba77eb Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 22/53] openssh-6.8p1-sshdT-output
@@ -9,10 +9,10 @@ Subject: [PATCH 22/53] openssh-6.8p1-sshdT-output
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/servconf.c b/servconf.c
-index 3dbfccea8..27147a1e7 100644
+index 0cfc2f3d8..f241b39bd 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -4294,7 +4294,7 @@ dump_config(ServerOptions *o)
+@@ -4425,7 +4425,7 @@ dump_config(ServerOptions *o)
  	dump_cfg_string(sXAuthLocation, o->xauth_location);
  	dump_cfg_string(sCiphers, o->ciphers);
  	dump_cfg_string(sMacs, o->macs);
@@ -22,5 +22,5 @@ index 3dbfccea8..27147a1e7 100644
  	dump_cfg_string(sChrootDirectory, o->chroot_directory);
  	dump_cfg_string(sTrustedUserCAKeys, o->trusted_user_ca_keys);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0023-openssh-6.7p1-sftp-force-permission.patch b/0023-openssh-6.7p1-sftp-force-permission.patch
index 049b61e..7de4a26 100644
--- a/0023-openssh-6.7p1-sftp-force-permission.patch
+++ b/0023-openssh-6.7p1-sftp-force-permission.patch
@@ -1,4 +1,4 @@
-From 71b2ca7bbf39514e96da573758d157a7d52625bc Mon Sep 17 00:00:00 2001
+From ddf3bce18db9921dd13c3a871c14e4273e0af06e Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 23/53] openssh-6.7p1-sftp-force-permission
@@ -10,7 +10,7 @@ Subject: [PATCH 23/53] openssh-6.7p1-sftp-force-permission
  2 files changed, 29 insertions(+), 2 deletions(-)
 
 diff --git a/sftp-server.8 b/sftp-server.8
-index d9060ab9a..cd5b035d6 100644
+index 711067eb1..4b40cd07e 100644
 --- a/sftp-server.8
 +++ b/sftp-server.8
 @@ -38,6 +38,7 @@
@@ -112,5 +112,5 @@ index eef9a96f8..567cf6e9a 100644
  		default:
  			sftp_server_usage();
 -- 
-2.55.0
+2.56.0
 

diff --git a/0024-openssh-7.2p2-s390-closefrom.patch b/0024-openssh-7.2p2-s390-closefrom.patch
index 2c95518..f8f6f5c 100644
--- a/0024-openssh-7.2p2-s390-closefrom.patch
+++ b/0024-openssh-7.2p2-s390-closefrom.patch
@@ -1,4 +1,4 @@
-From dd953f0572ef6b53825afb50cc44d65b2047831e Mon Sep 17 00:00:00 2001
+From 157671a6eeef976de0f2bf7777c810ff0000aa8c Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 24/53] openssh-7.2p2-s390-closefrom
@@ -47,5 +47,5 @@ index 49a4f35ff..f61124585 100644
  	(void) closedir(dirp);
  	return;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0025-openssh-7.5p1-sandbox.patch b/0025-openssh-7.5p1-sandbox.patch
index d24685a..56e9a64 100644
--- a/0025-openssh-7.5p1-sandbox.patch
+++ b/0025-openssh-7.5p1-sandbox.patch
@@ -1,4 +1,4 @@
-From 4688280417e4ea28be7683b554f91e31f234136b Mon Sep 17 00:00:00 2001
+From 06d3d3ec2a20c238018b3513ee8c3804333391f9 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 25/53] openssh-7.5p1-sandbox
@@ -9,7 +9,7 @@ Subject: [PATCH 25/53] openssh-7.5p1-sandbox
  1 file changed, 21 insertions(+)
 
 diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
-index bf753eef2..b65413c95 100644
+index f696d5008..b8c0b6d64 100644
 --- a/sandbox-seccomp-filter.c
 +++ b/sandbox-seccomp-filter.c
 @@ -305,6 +305,9 @@ static const struct sock_filter preauth_insns[] = {
@@ -55,5 +55,5 @@ index bf753eef2..b65413c95 100644
  	SC_ALLOW(__NR_getuid),
  #endif
 -- 
-2.55.0
+2.56.0
 

diff --git a/0026-openssh-7.8p1-scp-ipv6.patch b/0026-openssh-7.8p1-scp-ipv6.patch
index 7faacb0..5f0131a 100644
--- a/0026-openssh-7.8p1-scp-ipv6.patch
+++ b/0026-openssh-7.8p1-scp-ipv6.patch
@@ -1,4 +1,4 @@
-From 46c63b52afa8136a46a9094a69b4c011f22b44ac Mon Sep 17 00:00:00 2001
+From dcd4c76ef216e4493d4a469304afe71bd8ed7f43 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 26/53] openssh-7.8p1-scp-ipv6
@@ -9,10 +9,10 @@ Subject: [PATCH 26/53] openssh-7.8p1-scp-ipv6
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/scp.c b/scp.c
-index fca4393f3..ac43ec5f4 100644
+index 8408e61ef..7eb8310c4 100644
 --- a/scp.c
 +++ b/scp.c
-@@ -1164,7 +1164,9 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
+@@ -1166,7 +1166,9 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
  			addargs(&alist, "%s", host);
  			addargs(&alist, "%s", cmd);
  			addargs(&alist, "%s", src);
@@ -24,5 +24,5 @@ index fca4393f3..ac43ec5f4 100644
  			    thost, targ);
  			if (do_local_cmd(&alist) != 0)
 -- 
-2.55.0
+2.56.0
 

diff --git a/0027-openssh-8.0p1-crypto-policies.patch b/0027-openssh-8.0p1-crypto-policies.patch
index 0145163..fda4682 100644
--- a/0027-openssh-8.0p1-crypto-policies.patch
+++ b/0027-openssh-8.0p1-crypto-policies.patch
@@ -1,15 +1,15 @@
-From 7a5ff8f728cfb98c90dcbe648723fb4d4ed02300 Mon Sep 17 00:00:00 2001
+From 928a38995ab234e713313e81afaa3e2b2d004c19 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 27/53] openssh-8.0p1-crypto-policies
 
 ---
- ssh_config.5  | 172 +++++++++++++++++++-------------------------
- sshd_config.5 | 193 ++++++++++++++++++--------------------------------
- 2 files changed, 139 insertions(+), 226 deletions(-)
+ ssh_config.5  | 168 ++++++++++++++++++--------------------------
+ sshd_config.5 | 189 ++++++++++++++++++--------------------------------
+ 2 files changed, 135 insertions(+), 222 deletions(-)
 
 diff --git a/ssh_config.5 b/ssh_config.5
-index 04797a1e9..c4c72f587 100644
+index 178f0f503..a003e37b8 100644
 --- a/ssh_config.5
 +++ b/ssh_config.5
 @@ -468,18 +468,13 @@ A single argument of
@@ -30,7 +30,7 @@ index 04797a1e9..c4c72f587 100644
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
 -.Pp
  If the specified list begins with a
@@ -126,7 +126,7 @@ index 04797a1e9..c4c72f587 100644
  If the specified list begins with a
  .Sq ^
  character, then the specified signature algorithms will be placed
--at the head of the default set.
+ at the head of the default set.
 -The default for this option is:
 -.Bd -literal -offset 3n
 -ssh-ed25519-cert-v01@openssh.com,
@@ -138,16 +138,15 @@ index 04797a1e9..c4c72f587 100644
 -webauthn-sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
 -rsa-sha2-512-cert-v01@openssh.com,
 -rsa-sha2-256-cert-v01@openssh.com,
--ssh-mldsa44-ed25519-cert-v01@openssh.com,
+-ssh-mldsa44-ed25519-cert,
 -ssh-ed25519,
 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -webauthn-sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
-+at the head of the built-in openssh default set.
  .Pp
  The
  .Fl Q
@@ -286,7 +285,7 @@ index 04797a1e9..c4c72f587 100644
  If the specified list begins with a
  .Sq ^
  character, then the specified algorithms will be placed at the head of the
--default set.
+ default set.
 -The default for this option is:
 -.Bd -literal -offset 3n
 -ssh-ed25519-cert-v01@openssh.com,
@@ -298,16 +297,15 @@ index 04797a1e9..c4c72f587 100644
 -webauthn-sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
 -rsa-sha2-512-cert-v01@openssh.com,
 -rsa-sha2-256-cert-v01@openssh.com,
--ssh-mldsa44-ed25519-cert-v01@openssh.com,
+-ssh-mldsa44-ed25519-cert,
 -ssh-ed25519,
 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -webauthn-sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
-+built-in openssh default set.
  .Pp
  The list of available signature algorithms may also be obtained using
  .Qq ssh -Q PubkeyAcceptedAlgorithms .
@@ -317,7 +315,7 @@ index 04797a1e9..c4c72f587 100644
  .It Cm PubkeyAuthentication
  Specifies whether to try public key authentication.
  The argument to this keyword must be
-@@ -2540,7 +2508,9 @@ for those users who do not have a configuration file.
+@@ -2547,7 +2515,9 @@ for those users who do not have a configuration file.
  This file must be world-readable.
  .El
  .Sh SEE ALSO
@@ -329,10 +327,10 @@ index 04797a1e9..c4c72f587 100644
  .An -nosplit
  OpenSSH is a derivative of the original and free
 diff --git a/sshd_config.5 b/sshd_config.5
-index 0077ee096..b72757895 100644
+index a700cfd3f..a2f87b0c0 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -383,18 +383,13 @@ If the argument is
+@@ -409,18 +409,13 @@ If the argument is
  then no banner is displayed.
  By default, no banner is displayed.
  .It Cm CASignatureAlgorithms
@@ -350,13 +348,13 @@ index 0077ee096..b72757895 100644
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
 -.Pp
  If the specified list begins with a
  .Sq +
  character, then the specified algorithms will be appended to the default set
-@@ -538,20 +533,25 @@ The default is
+@@ -564,20 +559,25 @@ The default is
  indicating not to
  .Xr chroot 2 .
  .It Cm Ciphers
@@ -386,7 +384,7 @@ index 0077ee096..b72757895 100644
  .Pp
  The supported ciphers are:
  .Pp
-@@ -578,13 +578,6 @@ aes256-gcm@openssh.com
+@@ -604,13 +604,6 @@ aes256-gcm@openssh.com
  chacha20-poly1305@openssh.com
  .El
  .Pp
@@ -400,7 +398,7 @@ index 0077ee096..b72757895 100644
  The list of available ciphers may also be obtained using
  .Qq ssh -Q cipher .
  .It Cm ClientAliveCountMax
-@@ -798,60 +791,46 @@ For this to work
+@@ -824,60 +817,46 @@ For this to work
  .Cm GSSAPIKeyExchange
  needs to be enabled in the server and also used by the client.
  .It Cm GSSAPIKexAlgorithms
@@ -455,7 +453,7 @@ index 0077ee096..b72757895 100644
  If the specified list begins with a
  .Sq ^
  character, then the specified signature algorithms will be placed at
--the head of the default set.
+ the head of the default set.
 -The default for this option is:
 -.Bd -literal -offset 3n
 -ssh-ed25519-cert-v01@openssh.com,
@@ -467,20 +465,19 @@ index 0077ee096..b72757895 100644
 -webauthn-sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
 -rsa-sha2-512-cert-v01@openssh.com,
 -rsa-sha2-256-cert-v01@openssh.com,
--ssh-mldsa44-ed25519-cert-v01@openssh.com,
+-ssh-mldsa44-ed25519-cert,
 -ssh-ed25519,
 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -webauthn-sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed2551
 -.Ed
-+the head of the built-in openssh default set.
  .Pp
  The list of available signature algorithms may also be obtained using
  .Qq ssh -Q HostbasedAcceptedAlgorithms .
-@@ -919,29 +898,13 @@ is specified, the location of the socket will be read from the
+@@ -945,29 +924,13 @@ is specified, the location of the socket will be read from the
  .Ev SSH_AUTH_SOCK
  environment variable.
  .It Cm HostKeyAlgorithms
@@ -502,20 +499,20 @@ index 0077ee096..b72757895 100644
 -webauthn-sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
 -rsa-sha2-512-cert-v01@openssh.com,
 -rsa-sha2-256-cert-v01@openssh.com,
--ssh-mldsa44-ed25519-cert-v01@openssh.com,
+-ssh-mldsa44-ed25519-cert,
 -ssh-ed25519,
 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -webauthn-sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
 -.Pp
  The list of available signature algorithms may also be obtained using
  .Qq ssh -Q HostKeyAlgorithms .
  .It Cm IgnoreRhosts
-@@ -1087,6 +1050,11 @@ Specifies whether to look at .k5login file for user's aliases.
+@@ -1113,6 +1076,11 @@ Specifies whether to look at .k5login file for user's aliases.
  The default is
  .Cm yes .
  .It Cm KexAlgorithms
@@ -527,7 +524,7 @@ index 0077ee096..b72757895 100644
  Specifies the permitted KEX (Key Exchange) algorithms that the server will
  offer to clients.
  The ordering of this list is not important, as the client specifies the
-@@ -1095,16 +1063,16 @@ Multiple algorithms must be comma-separated.
+@@ -1121,16 +1089,16 @@ Multiple algorithms must be comma-separated.
  .Pp
  If the specified list begins with a
  .Sq +
@@ -548,7 +545,7 @@ index 0077ee096..b72757895 100644
  .Pp
  The supported algorithms are:
  .Pp
-@@ -1143,14 +1111,6 @@ sntrup761x25519-sha512
+@@ -1169,14 +1137,6 @@ sntrup761x25519-sha512
  sntrup761x25519-sha512@openssh.com
  .El
  .Pp
@@ -563,7 +560,7 @@ index 0077ee096..b72757895 100644
  The list of supported key exchange algorithms may also be obtained using
  .Qq ssh -Q KexAlgorithms .
  .It Cm ListenAddress
-@@ -1237,21 +1197,26 @@ function, and all code in the
+@@ -1263,21 +1223,26 @@ function, and all code in the
  file.
  This option is intended for debugging and no overrides are enabled by default.
  .It Cm MACs
@@ -594,7 +591,7 @@ index 0077ee096..b72757895 100644
  .Pp
  The algorithms that contain
  .Qq -etm
-@@ -1294,15 +1259,6 @@ umac-64-etm@openssh.com
+@@ -1320,15 +1285,6 @@ umac-64-etm@openssh.com
  umac-128-etm@openssh.com
  .El
  .Pp
@@ -610,7 +607,7 @@ index 0077ee096..b72757895 100644
  The list of available MAC algorithms may also be obtained using
  .Qq ssh -Q mac .
  .It Cm Match
-@@ -1792,40 +1748,25 @@ or equivalent.)
+@@ -1818,40 +1774,25 @@ or equivalent.)
  The default is
  .Cm yes .
  .It Cm PubkeyAcceptedAlgorithms
@@ -635,7 +632,7 @@ index 0077ee096..b72757895 100644
  If the specified list begins with a
  .Sq ^
  character, then the specified algorithms will be placed at the head of the
--default set.
+ default set.
 -The default for this option is:
 -.Bd -literal -offset 3n
 -ssh-ed25519-cert-v01@openssh.com,
@@ -647,20 +644,19 @@ index 0077ee096..b72757895 100644
 -webauthn-sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
 -rsa-sha2-512-cert-v01@openssh.com,
 -rsa-sha2-256-cert-v01@openssh.com,
--ssh-mldsa44-ed25519-cert-v01@openssh.com,
+-ssh-mldsa44-ed25519-cert,
 -ssh-ed25519,
 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
 -sk-ssh-ed25519@openssh.com,
 -sk-ecdsa-sha2-nistp256@openssh.com,
 -webauthn-sk-ecdsa-sha2-nistp256@openssh.com,
 -rsa-sha2-512,rsa-sha2-256,
--ssh-mldsa44-ed25519@openssh.com
+-ssh-mldsa44-ed25519
 -.Ed
-+built-in openssh default set.
  .Pp
  The list of available signature algorithms may also be obtained using
  .Qq ssh -Q PubkeyAcceptedAlgorithms .
-@@ -2338,7 +2279,9 @@ This file should be writable by root only, but it is recommended
+@@ -2401,7 +2342,9 @@ This file should be writable by root only, but it is recommended
  .El
  .Sh SEE ALSO
  .Xr sftp-server 8 ,
@@ -672,5 +668,5 @@ index 0077ee096..b72757895 100644
  .An -nosplit
  OpenSSH is a derivative of the original and free
 -- 
-2.55.0
+2.56.0
 

diff --git a/0028-openssh-8.0p1-openssl-kdf.patch b/0028-openssh-8.0p1-openssl-kdf.patch
index 9c3d58c..ea5465d 100644
--- a/0028-openssh-8.0p1-openssl-kdf.patch
+++ b/0028-openssh-8.0p1-openssl-kdf.patch
@@ -1,4 +1,4 @@
-From 1fdd8f9ddb1b2e1e0d4f7d97e5e7e17b74a85a6a Mon Sep 17 00:00:00 2001
+From 5d7aa68af8286b80870e143429d21f224345ae1f Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 28/53] openssh-8.0p1-openssl-kdf
@@ -10,10 +10,10 @@ Subject: [PATCH 28/53] openssh-8.0p1-openssl-kdf
  2 files changed, 108 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index cb46903f4..394acc3d8 100644
+index c987e44ad..831b611bd 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -3261,6 +3261,7 @@ if test "x$openssl" = "xyes" ; then
+@@ -3268,6 +3268,7 @@ if test "x$openssl" = "xyes" ; then
  		HMAC_CTX_init \
  		RSA_generate_key_ex \
  		RSA_get_default_method \
@@ -22,7 +22,7 @@ index cb46903f4..394acc3d8 100644
  
  	# LibreSSL/OpenSSL API differences
 diff --git a/kex.c b/kex.c
-index 1b8f1c3c5..6981b59f5 100644
+index aa3d8d892..1a9bbb16b 100644
 --- a/kex.c
 +++ b/kex.c
 @@ -37,6 +37,11 @@
@@ -37,7 +37,7 @@ index 1b8f1c3c5..6981b59f5 100644
  #endif
  
  #include "ssh.h"
-@@ -1086,6 +1091,107 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
+@@ -1121,6 +1126,107 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
  	return r;
  }
  
@@ -145,7 +145,7 @@ index 1b8f1c3c5..6981b59f5 100644
  static int
  derive_key(struct ssh *ssh, int id, u_int need, u_char *hash, u_int hashlen,
      const struct sshbuf *shared_secret, u_char **keyp)
-@@ -1149,6 +1255,7 @@ derive_key(struct ssh *ssh, int id, u_int need, u_char *hash, u_int hashlen,
+@@ -1184,6 +1290,7 @@ derive_key(struct ssh *ssh, int id, u_int need, u_char *hash, u_int hashlen,
  	ssh_digest_free(hashctx);
  	return r;
  }
@@ -154,5 +154,5 @@ index 1b8f1c3c5..6981b59f5 100644
  #define NKEYS	6
  int
 -- 
-2.55.0
+2.56.0
 

diff --git a/0029-openssh-8.2p1-visibility.patch b/0029-openssh-8.2p1-visibility.patch
index 4008c0c..6eceae6 100644
--- a/0029-openssh-8.2p1-visibility.patch
+++ b/0029-openssh-8.2p1-visibility.patch
@@ -1,4 +1,4 @@
-From 0c8380243aa47419186f12070b4115846bf9b425 Mon Sep 17 00:00:00 2001
+From d498de77e75f0c5810dff5d613ad947e6d4548ba Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 29/53] openssh-8.2p1-visibility
@@ -9,7 +9,7 @@ Subject: [PATCH 29/53] openssh-8.2p1-visibility
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/regress/misc/sk-dummy/sk-dummy.c b/regress/misc/sk-dummy/sk-dummy.c
-index cbbba7459..f1b3f060b 100644
+index f96747288..0678bcc9d 100644
 --- a/regress/misc/sk-dummy/sk-dummy.c
 +++ b/regress/misc/sk-dummy/sk-dummy.c
 @@ -80,7 +80,7 @@ skdebug(const char *func, const char *fmt, ...)
@@ -30,7 +30,7 @@ index cbbba7459..f1b3f060b 100644
  sk_enroll(uint32_t alg, const uint8_t *challenge, size_t challenge_len,
      const char *application, uint8_t flags, const char *pin,
      struct sk_option **options, struct sk_enroll_response **enroll_response)
-@@ -477,7 +477,7 @@ sig_ed25519(const uint8_t *message, size_t message_len,
+@@ -475,7 +475,7 @@ sig_ed25519(const uint8_t *message, size_t message_len,
  	return ret;
  }
  
@@ -39,7 +39,7 @@ index cbbba7459..f1b3f060b 100644
  sk_sign(uint32_t alg, const uint8_t *data, size_t datalen,
      const char *application, const uint8_t *key_handle, size_t key_handle_len,
      uint8_t flags, const char *pin, struct sk_option **options,
-@@ -534,7 +534,7 @@ sk_sign(uint32_t alg, const uint8_t *data, size_t datalen,
+@@ -532,7 +532,7 @@ sk_sign(uint32_t alg, const uint8_t *data, size_t datalen,
  	return ret;
  }
  
@@ -49,5 +49,5 @@ index cbbba7459..f1b3f060b 100644
      struct sk_resident_key ***rks, size_t *nrks)
  {
 -- 
-2.55.0
+2.56.0
 

diff --git a/0030-openssh-8.2p1-x11-without-ipv6.patch b/0030-openssh-8.2p1-x11-without-ipv6.patch
index 373e889..d1933dc 100644
--- a/0030-openssh-8.2p1-x11-without-ipv6.patch
+++ b/0030-openssh-8.2p1-x11-without-ipv6.patch
@@ -1,4 +1,4 @@
-From a29df25b1ed0d2945d0990bc7ca8918c16c7d264 Mon Sep 17 00:00:00 2001
+From e83d40875ee3ea7927d564b067a0f77deae4c448 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 30/53] openssh-8.2p1-x11-without-ipv6
@@ -9,10 +9,10 @@ Subject: [PATCH 30/53] openssh-8.2p1-x11-without-ipv6
  1 file changed, 10 insertions(+)
 
 diff --git a/channels.c b/channels.c
-index fcd80288f..bae84e5f9 100644
+index abae44b92..a8e77e2b5 100644
 --- a/channels.c
 +++ b/channels.c
-@@ -5141,6 +5141,16 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
+@@ -5198,6 +5198,16 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
  				debug2_f("bind port %d: %.100s", port,
  				    strerror(errno));
  				close(sock);
@@ -30,5 +30,5 @@ index fcd80288f..bae84e5f9 100644
  					close(socks[n]);
  				num_socks = 0;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0031-openssh-8.0p1-preserve-pam-errors.patch b/0031-openssh-8.0p1-preserve-pam-errors.patch
index ad8382c..487e9ec 100644
--- a/0031-openssh-8.0p1-preserve-pam-errors.patch
+++ b/0031-openssh-8.0p1-preserve-pam-errors.patch
@@ -1,4 +1,4 @@
-From 74d160a951c390e2c690bf3462b643b7328e3b89 Mon Sep 17 00:00:00 2001
+From 2154bd20aaa35ec4c2dd98acc173007c09bb119e Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 31/53] openssh-8.0p1-preserve-pam-errors
@@ -53,5 +53,5 @@ index 3f342f9e1..d3dcd037b 100644
  				sshpam_set_maxtries_reached(1);
  			/* FALLTHROUGH */
 -- 
-2.55.0
+2.56.0
 

diff --git a/0032-openssh-8.7p1-scp-kill-switch.patch b/0032-openssh-8.7p1-scp-kill-switch.patch
index 6ba3100..fb5fd37 100644
--- a/0032-openssh-8.7p1-scp-kill-switch.patch
+++ b/0032-openssh-8.7p1-scp-kill-switch.patch
@@ -1,4 +1,4 @@
-From ee385dfe54142b1f8c03f20b8a63b9f8f1b52b3f Mon Sep 17 00:00:00 2001
+From fefcd308985886865df45b55af79059951af04a0 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 32/53] openssh-8.7p1-scp-kill-switch
@@ -11,7 +11,7 @@ Subject: [PATCH 32/53] openssh-8.7p1-scp-kill-switch
  3 files changed, 16 insertions(+)
 
 diff --git a/pathnames.h b/pathnames.h
-index 2f0b9f4f6..ce5ddc14f 100644
+index 8713153dc..a94aec6ac 100644
 --- a/pathnames.h
 +++ b/pathnames.h
 @@ -41,6 +41,7 @@
@@ -23,7 +23,7 @@ index 2f0b9f4f6..ce5ddc14f 100644
  #ifndef _PATH_SSH_PROGRAM
  #define _PATH_SSH_PROGRAM		"/usr/bin/ssh"
 diff --git a/scp.1 b/scp.1
-index 7bce0fe6f..2bb838c7d 100644
+index 6daf59420..cd7b91c80 100644
 --- a/scp.1
 +++ b/scp.1
 @@ -334,6 +334,13 @@ during download or upload.
@@ -41,10 +41,10 @@ index 7bce0fe6f..2bb838c7d 100644
  .Ex -std scp
  .Sh SEE ALSO
 diff --git a/scp.c b/scp.c
-index ac43ec5f4..5775be457 100644
+index 7eb8310c4..134231ecd 100644
 --- a/scp.c
 +++ b/scp.c
-@@ -628,6 +628,14 @@ main(int argc, char **argv)
+@@ -630,6 +630,14 @@ main(int argc, char **argv)
  	if (iamremote)
  		mode = MODE_SCP;
  
@@ -60,5 +60,5 @@ index ac43ec5f4..5775be457 100644
  		fatal("unknown user %u", (u_int) userid);
  
 -- 
-2.55.0
+2.56.0
 

diff --git a/0033-openssh-8.7p1-recursive-scp.patch b/0033-openssh-8.7p1-recursive-scp.patch
index 83ac8d3..68ce8f1 100644
--- a/0033-openssh-8.7p1-recursive-scp.patch
+++ b/0033-openssh-8.7p1-recursive-scp.patch
@@ -1,4 +1,4 @@
-From f21a7b168a25eca8ef2928eb546642974d2d2a31 Mon Sep 17 00:00:00 2001
+From ef9865206c8da65194adf7cd45dd820f6020bd5a Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 33/53] openssh-8.7p1-recursive-scp
@@ -15,10 +15,10 @@ Subject: [PATCH 33/53] openssh-8.7p1-recursive-scp
  4 files changed, 52 insertions(+), 20 deletions(-)
 
 diff --git a/scp.c b/scp.c
-index 5775be457..646cf2478 100644
+index 134231ecd..b6a729eb0 100644
 --- a/scp.c
 +++ b/scp.c
-@@ -1377,7 +1377,7 @@ source_sftp(int argc, char *src, char *targ, struct sftp_conn *conn)
+@@ -1379,7 +1379,7 @@ source_sftp(int argc, char *src, char *targ, struct sftp_conn *conn)
  
  	if (src_is_dir && iamrecursive) {
  		if (sftp_upload_dir(conn, src, abs_dst, pflag,
@@ -28,10 +28,10 @@ index 5775be457..646cf2478 100644
  			errs = 1;
  		}
 diff --git a/sftp-client.c b/sftp-client.c
-index 1f031128e..aad864357 100644
+index 791b37c6d..95e443890 100644
 --- a/sftp-client.c
 +++ b/sftp-client.c
-@@ -988,7 +988,7 @@ sftp_fsetstat(struct sftp_conn *conn, const u_char *handle, u_int handle_len,
+@@ -1022,7 +1022,7 @@ sftp_fsetstat(struct sftp_conn *conn, const u_char *handle, u_int handle_len,
  
  /* Implements both the realpath and expand-path operations */
  static char *
@@ -40,7 +40,7 @@ index 1f031128e..aad864357 100644
  {
  	struct sshbuf *msg;
  	u_int expected_id, count, id;
-@@ -1034,11 +1034,43 @@ sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
+@@ -1068,11 +1068,43 @@ sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
  		if ((r = sshbuf_get_u32(msg, &status)) != 0 ||
  		    (r = sshbuf_get_cstring(msg, &errmsg, NULL)) != 0)
  			fatal_fr(r, "parse status");
@@ -89,7 +89,7 @@ index 1f031128e..aad864357 100644
  	} else if (type != SSH2_FXP_NAME)
  		fatal("Expected SSH2_FXP_NAME(%u) packet, got %u",
  		    SSH2_FXP_NAME, type);
-@@ -1063,9 +1095,9 @@ sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
+@@ -1097,9 +1129,9 @@ sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
  }
  
  char *
@@ -101,7 +101,7 @@ index 1f031128e..aad864357 100644
  }
  
  int
-@@ -1079,9 +1111,9 @@ sftp_expand_path(struct sftp_conn *conn, const char *path)
+@@ -1113,9 +1145,9 @@ sftp_expand_path(struct sftp_conn *conn, const char *path)
  {
  	if (!sftp_can_expand_path(conn)) {
  		debug3_f("no server support, fallback to realpath");
@@ -113,7 +113,7 @@ index 1f031128e..aad864357 100644
  }
  
  int
-@@ -2006,7 +2038,7 @@ sftp_download_dir(struct sftp_conn *conn, const char *src, const char *dst,
+@@ -2040,7 +2072,7 @@ sftp_download_dir(struct sftp_conn *conn, const char *src, const char *dst,
  	char *src_canon;
  	int ret;
  
@@ -122,7 +122,7 @@ index 1f031128e..aad864357 100644
  		error("download \"%s\": path canonicalization failed", src);
  		return -1;
  	}
-@@ -2361,12 +2393,12 @@ upload_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
+@@ -2395,12 +2427,12 @@ upload_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
  int
  sftp_upload_dir(struct sftp_conn *conn, const char *src, const char *dst,
      int preserve_flag, int print_flag, int resume, int fsync_flag,
@@ -137,7 +137,7 @@ index 1f031128e..aad864357 100644
  		error("upload \"%s\": path canonicalization failed", dst);
  		return -1;
  	}
-@@ -2829,7 +2861,7 @@ sftp_crossload_dir(struct sftp_conn *from, struct sftp_conn *to,
+@@ -2863,7 +2895,7 @@ sftp_crossload_dir(struct sftp_conn *from, struct sftp_conn *to,
  	char *from_path_canon;
  	int ret;
  
@@ -147,10 +147,10 @@ index 1f031128e..aad864357 100644
  		    from_path);
  		return -1;
 diff --git a/sftp-client.h b/sftp-client.h
-index cc8e20298..36b68d4cc 100644
+index dc7c28e6c..6980637af 100644
 --- a/sftp-client.h
 +++ b/sftp-client.h
-@@ -106,7 +106,7 @@ int sftp_fsetstat(struct sftp_conn *, const u_char *, u_int, Attrib *);
+@@ -109,7 +109,7 @@ int sftp_fsetstat(struct sftp_conn *, const u_char *, u_int, Attrib *);
  int sftp_lsetstat(struct sftp_conn *conn, const char *path, Attrib *a);
  
  /* Canonicalise 'path' - caller must free result */
@@ -159,7 +159,7 @@ index cc8e20298..36b68d4cc 100644
  
  /* Canonicalisation with tilde expansion (requires server extension) */
  char *sftp_expand_path(struct sftp_conn *, const char *);
-@@ -158,7 +158,7 @@ int sftp_upload(struct sftp_conn *, const char *, const char *,
+@@ -161,7 +161,7 @@ int sftp_upload(struct sftp_conn *, const char *, const char *,
   * times if 'pflag' is set
   */
  int sftp_upload_dir(struct sftp_conn *, const char *, const char *,
@@ -169,10 +169,10 @@ index cc8e20298..36b68d4cc 100644
  /*
   * Download a 'from_path' from the 'from' connection and upload it to
 diff --git a/sftp.c b/sftp.c
-index 31d8fa494..d3be72ffe 100644
+index ecbaefd61..bf809f6f3 100644
 --- a/sftp.c
 +++ b/sftp.c
-@@ -804,7 +804,7 @@ process_put(struct sftp_conn *conn, const char *src, const char *dst,
+@@ -834,7 +834,7 @@ process_put(struct sftp_conn *conn, const char *src, const char *dst,
  		    (rflag || global_rflag)) {
  			if (sftp_upload_dir(conn, g.gl_pathv[i], abs_dst,
  			    pflag || global_pflag, 1, resume,
@@ -181,7 +181,7 @@ index 31d8fa494..d3be72ffe 100644
  				err = -1;
  		} else {
  			if (sftp_upload(conn, g.gl_pathv[i], abs_dst,
-@@ -1649,7 +1649,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
+@@ -1690,7 +1690,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
  		if (path1 == NULL || *path1 == '\0')
  			path1 = xstrdup(startdir);
  		path1 = sftp_make_absolute(path1, *pwd);
@@ -190,7 +190,7 @@ index 31d8fa494..d3be72ffe 100644
  			err = 1;
  			break;
  		}
-@@ -2275,7 +2275,7 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2)
+@@ -2321,7 +2321,7 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2)
  	}
  #endif /* USE_LIBEDIT */
  
@@ -200,5 +200,5 @@ index 31d8fa494..d3be72ffe 100644
  	startdir = xstrdup(remote_path);
  
 -- 
-2.55.0
+2.56.0
 

diff --git a/0034-openssh-8.7p1-ibmca.patch b/0034-openssh-8.7p1-ibmca.patch
index 8ca4ccb..efd073e 100644
--- a/0034-openssh-8.7p1-ibmca.patch
+++ b/0034-openssh-8.7p1-ibmca.patch
@@ -1,4 +1,4 @@
-From 5330624d76a24557fb71d8852c6e5e1c8edce762 Mon Sep 17 00:00:00 2001
+From ba3fc4ba26aee5474f0a82dea44eb99a203c373b Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 34/53] openssh-8.7p1-ibmca
@@ -23,5 +23,5 @@ index f61124585..417c20484 100644
  #include <sys/types.h>
  #include <unistd.h>
 -- 
-2.55.0
+2.56.0
 

diff --git a/0035-openssh-7.6p1-audit.patch b/0035-openssh-7.6p1-audit.patch
index 51d7285..6ab961e 100644
--- a/0035-openssh-7.6p1-audit.patch
+++ b/0035-openssh-7.6p1-audit.patch
@@ -1,4 +1,4 @@
-From 6fefa768f29953c62f81f6e4e8e70e32f6c48dd9 Mon Sep 17 00:00:00 2001
+From 3b6c45fa20e35c08c740421ff8b2393569f13e81 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 35/53] openssh-7.6p1-audit
@@ -35,7 +35,7 @@ Subject: [PATCH 35/53] openssh-7.6p1-audit
  create mode 100644 auditstub.c
 
 diff --git a/Makefile.in b/Makefile.in
-index 1eeb34cad..f61f89e4d 100644
+index 7d16aea62..5e539a2cc 100644
 --- a/Makefile.in
 +++ b/Makefile.in
 @@ -111,7 +111,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
@@ -796,10 +796,10 @@ index 9d1307b76..9851625cf 100644
  	}
  	if (!allowed_user(ssh, pw))
 diff --git a/auth.h b/auth.h
-index 9dd25f494..066f5effa 100644
+index 2e0051899..82f01af74 100644
 --- a/auth.h
 +++ b/auth.h
-@@ -214,6 +214,8 @@ struct sshkey	*get_hostkey_private_by_type(int, int, struct ssh *);
+@@ -216,6 +216,8 @@ struct sshkey	*get_hostkey_private_by_type(int, int, struct ssh *);
  int	 get_hostkey_index(struct sshkey *, int, struct ssh *);
  int	 sshd_hostkey_sign(struct ssh *, struct sshkey *, struct sshkey *,
      u_char **, size_t *, const u_char *, size_t, const char *);
@@ -808,7 +808,7 @@ index 9dd25f494..066f5effa 100644
  
  /* Key / cert options linkage to auth layer */
  int	 auth_activate_options(struct ssh *, struct sshauthopt *);
-@@ -239,6 +241,8 @@ int	 auth_check_authkey_line(struct passwd *, struct sshkey *,
+@@ -241,6 +243,8 @@ int	 auth_check_authkey_line(struct passwd *, struct sshkey *,
      char *, const char *, const char *, const char *, struct sshauthopt **);
  int	 auth_check_authkeys_file(struct passwd *, FILE *, char *,
      struct sshkey *, const char *, const char *, struct sshauthopt **);
@@ -818,10 +818,10 @@ index 9dd25f494..066f5effa 100644
  FILE	*auth_openprincipals(const char *, struct passwd *, int);
  
 diff --git a/auth2-hostbased.c b/auth2-hostbased.c
-index 6a6704d93..d877471da 100644
+index 4322d7b4f..53ed6e824 100644
 --- a/auth2-hostbased.c
 +++ b/auth2-hostbased.c
-@@ -159,7 +159,7 @@ userauth_hostbased(struct ssh *ssh, const char *method)
+@@ -166,7 +166,7 @@ userauth_hostbased(struct ssh *ssh, const char *method)
  	authenticated = 0;
  	if (mm_hostbased_key_allowed(ssh, authctxt->pw, cuser,
  	    chost, key) &&
@@ -830,7 +830,7 @@ index 6a6704d93..d877471da 100644
  	    sshbuf_ptr(b), sshbuf_len(b), pkalg, ssh->compat, NULL) == 0)
  		authenticated = 1;
  
-@@ -176,6 +176,20 @@ done:
+@@ -183,6 +183,20 @@ done:
  	return authenticated;
  }
  
@@ -852,10 +852,10 @@ index 6a6704d93..d877471da 100644
  int
  hostbased_key_allowed(struct ssh *ssh, struct passwd *pw,
 diff --git a/auth2-pubkey.c b/auth2-pubkey.c
-index dc07faa92..f2a4329e5 100644
+index 88cbab533..0b162505a 100644
 --- a/auth2-pubkey.c
 +++ b/auth2-pubkey.c
-@@ -230,7 +230,7 @@ userauth_pubkey(struct ssh *ssh, const char *method)
+@@ -252,7 +252,7 @@ userauth_pubkey(struct ssh *ssh, const char *method)
  		/* test for correct signature */
  		authenticated = 0;
  		if (mm_user_key_allowed(ssh, pw, key, 1, &authopts) &&
@@ -864,7 +864,7 @@ index dc07faa92..f2a4329e5 100644
  		    sshbuf_ptr(b), sshbuf_len(b),
  		    (ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL,
  		    ssh->compat, &sig_details) == 0) {
-@@ -323,6 +323,20 @@ done:
+@@ -360,6 +360,20 @@ done:
  	return authenticated;
  }
  
@@ -886,7 +886,7 @@ index dc07faa92..f2a4329e5 100644
  match_principals_file(struct passwd *pw, char *file,
      struct sshkey_cert *cert, struct sshauthopt **authoptsp)
 diff --git a/auth2.c b/auth2.c
-index f0f39707f..71460d78f 100644
+index 547ceb95c..724183e10 100644
 --- a/auth2.c
 +++ b/auth2.c
 @@ -321,9 +321,6 @@ input_userauth_request(int type, uint32_t seq, struct ssh *ssh)
@@ -970,7 +970,7 @@ index 32abdde22..e953dfc3c 100644
  
  const struct sshcipher *cipher_by_name(const char *);
 diff --git a/kex.c b/kex.c
-index 6981b59f5..9ce2b7e12 100644
+index 1a9bbb16b..d68ad2364 100644
 --- a/kex.c
 +++ b/kex.c
 @@ -64,6 +64,7 @@
@@ -981,7 +981,7 @@ index 6981b59f5..9ce2b7e12 100644
  
  /* prototype */
  static int kex_choose_conf(struct ssh *, uint32_t seq);
-@@ -829,12 +830,16 @@ kex_start_rekex(struct ssh *ssh)
+@@ -864,12 +865,16 @@ kex_start_rekex(struct ssh *ssh)
  }
  
  static int
@@ -1000,7 +1000,7 @@ index 6981b59f5..9ce2b7e12 100644
  	if ((enc->cipher = cipher_by_name(name)) == NULL) {
  		error_f("unsupported cipher %s", name);
  		free(name);
-@@ -855,8 +860,12 @@ choose_mac(struct ssh *ssh, struct sshmac *mac, char *client, char *server)
+@@ -890,8 +895,12 @@ choose_mac(struct ssh *ssh, struct sshmac *mac, char *client, char *server)
  {
  	char *name = match_list(client, server, NULL);
  
@@ -1014,7 +1014,7 @@ index 6981b59f5..9ce2b7e12 100644
  	if (mac_setup(mac, name) < 0) {
  		error_f("unsupported MAC %s", name);
  		free(name);
-@@ -869,12 +878,16 @@ choose_mac(struct ssh *ssh, struct sshmac *mac, char *client, char *server)
+@@ -904,12 +913,16 @@ choose_mac(struct ssh *ssh, struct sshmac *mac, char *client, char *server)
  }
  
  static int
@@ -1033,7 +1033,7 @@ index 6981b59f5..9ce2b7e12 100644
  #ifdef WITH_ZLIB
  	if (strcmp(name, "zlib@openssh.com") == 0) {
  		comp->type = COMP_DELAYED;
-@@ -1038,7 +1051,7 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
+@@ -1073,7 +1086,7 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
  		nenc  = ctos ? PROPOSAL_ENC_ALGS_CTOS  : PROPOSAL_ENC_ALGS_STOC;
  		nmac  = ctos ? PROPOSAL_MAC_ALGS_CTOS  : PROPOSAL_MAC_ALGS_STOC;
  		ncomp = ctos ? PROPOSAL_COMP_ALGS_CTOS : PROPOSAL_COMP_ALGS_STOC;
@@ -1042,7 +1042,7 @@ index 6981b59f5..9ce2b7e12 100644
  		    sprop[nenc])) != 0) {
  			kex->failed_choice = peer[nenc];
  			peer[nenc] = NULL;
-@@ -1053,7 +1066,7 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
+@@ -1088,7 +1101,7 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
  			peer[nmac] = NULL;
  			goto out;
  		}
@@ -1051,7 +1051,7 @@ index 6981b59f5..9ce2b7e12 100644
  		    sprop[ncomp])) != 0) {
  			kex->failed_choice = peer[ncomp];
  			peer[ncomp] = NULL;
-@@ -1076,6 +1089,10 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
+@@ -1111,6 +1124,10 @@ kex_choose_conf(struct ssh *ssh, uint32_t seq)
  		dh_need = MAXIMUM(dh_need, newkeys->enc.block_size);
  		dh_need = MAXIMUM(dh_need, newkeys->enc.iv_len);
  		dh_need = MAXIMUM(dh_need, newkeys->mac.key_len);
@@ -1062,7 +1062,7 @@ index 6981b59f5..9ce2b7e12 100644
  	}
  	/* XXX need runden? */
  	kex->we_need = need;
-@@ -1345,6 +1362,36 @@ dump_digest(const char *msg, const u_char *digest, int len)
+@@ -1380,6 +1397,36 @@ dump_digest(const char *msg, const u_char *digest, int len)
  }
  #endif
  
@@ -1100,10 +1100,10 @@ index 6981b59f5..9ce2b7e12 100644
   * Send a plaintext error message to the peer, suffixed by \r\n.
   * Only used during banner exchange, and there only for the server.
 diff --git a/kex.h b/kex.h
-index 21919a9aa..8f9934899 100644
+index 7846e7a6e..dc5b4d5d0 100644
 --- a/kex.h
 +++ b/kex.h
-@@ -257,6 +257,8 @@ int	 kexgss_client(struct ssh *);
+@@ -262,6 +262,8 @@ int	 kexgss_client(struct ssh *);
  int	 kexgss_server(struct ssh *);
  #endif
  
@@ -1149,7 +1149,7 @@ index 04089f41b..6b5ebc44b 100644
  
  #endif /* SSHMAC_H */
 diff --git a/monitor.c b/monitor.c
-index 14cdccf2f..733a3460f 100644
+index 9d562012d..3ae9705c3 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -83,6 +83,7 @@
@@ -1378,7 +1378,7 @@ index 14cdccf2f..733a3460f 100644
  }
  
  
-@@ -2259,3 +2339,102 @@ mm_answer_gss_updatecreds(struct ssh *ssh, int socket, struct sshbuf *m) {
+@@ -2261,3 +2341,102 @@ mm_answer_gss_updatecreds(struct ssh *ssh, int socket, struct sshbuf *m) {
  
  #endif /* GSSAPI */
  
@@ -1501,10 +1501,10 @@ index f4721c472..087addff5 100644
  	MONITOR_REQ_GSSSIGN = 150, MONITOR_ANS_GSSSIGN = 151,
  	MONITOR_REQ_GSSUPCREDS = 152, MONITOR_ANS_GSSUPCREDS = 153,
 diff --git a/monitor_wrap.c b/monitor_wrap.c
-index 2b044f383..bdac7d3f9 100644
+index d8f0469ee..0f2a01920 100644
 --- a/monitor_wrap.c
 +++ b/monitor_wrap.c
-@@ -565,7 +565,7 @@ mm_key_allowed(enum mm_keytype type, const char *user, const char *host,
+@@ -568,7 +568,7 @@ mm_key_allowed(enum mm_keytype type, const char *user, const char *host,
   */
  
  int
@@ -1513,7 +1513,7 @@ index 2b044f383..bdac7d3f9 100644
      const u_char *data, size_t datalen, const char *sigalg, u_int compat,
      struct sshkey_sig_details **sig_detailsp)
  {
-@@ -581,7 +581,8 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
+@@ -584,7 +584,8 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
  		*sig_detailsp = NULL;
  	if ((m = sshbuf_new()) == NULL)
  		fatal_f("sshbuf_new failed");
@@ -1523,7 +1523,7 @@ index 2b044f383..bdac7d3f9 100644
  	    (r = sshbuf_put_string(m, sig, siglen)) != 0 ||
  	    (r = sshbuf_put_string(m, data, datalen)) != 0 ||
  	    (r = sshbuf_put_cstring(m, sigalg == NULL ? "" : sigalg)) != 0)
-@@ -614,6 +615,22 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
+@@ -617,6 +618,22 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
  	return 0;
  }
  
@@ -1546,7 +1546,7 @@ index 2b044f383..bdac7d3f9 100644
  void
  mm_send_keystate(struct ssh *ssh, struct monitor *monitor)
  {
-@@ -1013,11 +1030,12 @@ mm_audit_event(struct ssh *ssh, ssh_audit_event_t event)
+@@ -1016,11 +1033,12 @@ mm_audit_event(struct ssh *ssh, ssh_audit_event_t event)
  	sshbuf_free(m);
  }
  
@@ -1561,7 +1561,7 @@ index 2b044f383..bdac7d3f9 100644
  
  	debug3_f("entering command %s", command);
  
-@@ -1027,6 +1045,30 @@ mm_audit_run_command(const char *command)
+@@ -1030,6 +1048,30 @@ mm_audit_run_command(const char *command)
  		fatal_fr(r, "buffer error");
  
  	mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_COMMAND, m);
@@ -1592,7 +1592,7 @@ index 2b044f383..bdac7d3f9 100644
  	sshbuf_free(m);
  }
  #endif /* SSH_AUDIT_EVENTS */
-@@ -1275,3 +1317,83 @@ server_get_connection_info(struct ssh *ssh, int populate, int use_dns)
+@@ -1279,3 +1321,83 @@ server_get_connection_info(struct ssh *ssh, int populate, int use_dns)
  	return &ci;
  }
  
@@ -1706,7 +1706,7 @@ index 07b207d1d..7f846f085 100644
  
  struct Session;
 diff --git a/packet.c b/packet.c
-index 63dcb5351..4c3c541ed 100644
+index d63c579de..cd0846942 100644
 --- a/packet.c
 +++ b/packet.c
 @@ -75,6 +75,7 @@
@@ -1717,7 +1717,7 @@ index 63dcb5351..4c3c541ed 100644
  #include "compat.h"
  #include "ssh2.h"
  #include "cipher.h"
-@@ -514,6 +515,13 @@ ssh_packet_get_connection_out(struct ssh *ssh)
+@@ -515,6 +516,13 @@ ssh_packet_get_connection_out(struct ssh *ssh)
  	return ssh->state->connection_out;
  }
  
@@ -1731,7 +1731,7 @@ index 63dcb5351..4c3c541ed 100644
  /*
   * Returns the IP-address of the remote host as a string.  The returned
   * string must not be freed.
-@@ -684,22 +692,19 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
+@@ -685,22 +693,19 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
  	struct session_state *state = ssh->state;
  	u_int mode;
  	struct packet *p;
@@ -1759,7 +1759,7 @@ index 63dcb5351..4c3c541ed 100644
  	while ((p = TAILQ_FIRST(&state->outgoing))) {
  		sshbuf_free(p->payload);
  		TAILQ_REMOVE(&state->outgoing, p, next);
-@@ -740,8 +745,18 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
+@@ -741,8 +746,18 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
  #endif	/* WITH_ZLIB */
  	cipher_free(state->send_context);
  	cipher_free(state->receive_context);
@@ -1778,7 +1778,7 @@ index 63dcb5351..4c3c541ed 100644
  		free(ssh->local_ipaddr);
  		ssh->local_ipaddr = NULL;
  		free(ssh->remote_ipaddr);
-@@ -1007,6 +1022,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
+@@ -1009,6 +1024,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
  		    (unsigned long long)state->p_send.bytes,
  		    (unsigned long long)state->p_send.blocks);
  		kex_free_newkeys(state->newkeys[mode]);
@@ -1786,7 +1786,7 @@ index 63dcb5351..4c3c541ed 100644
  		state->newkeys[mode] = NULL;
  	}
  	/* note that both bytes and the seqnr are not reset */
-@@ -2398,6 +2414,72 @@ ssh_packet_get_output(struct ssh *ssh)
+@@ -2400,6 +2416,72 @@ ssh_packet_get_output(struct ssh *ssh)
  	return (void *)ssh->state->output;
  }
  
@@ -1860,17 +1860,17 @@ index 63dcb5351..4c3c541ed 100644
  static int
  ssh_packet_set_postauth(struct ssh *ssh)
 diff --git a/packet.h b/packet.h
-index 442e38bb7..bfe481220 100644
+index ecab22a2d..5017cd4f8 100644
 --- a/packet.h
 +++ b/packet.h
-@@ -207,4 +207,5 @@ void	sshpkt_fmt_connection_id(struct ssh *ssh, char *s, size_t l);
+@@ -208,4 +208,5 @@ void	sshpkt_fmt_connection_id(struct ssh *ssh, char *s, size_t l);
  const u_char	*sshpkt_ptr(struct ssh *, size_t *lenp);
  char	*connection_info_message(struct ssh *ssh);
  
 +void	 packet_destroy_all(struct ssh *, int, int);
  #endif				/* PACKET_H */
 diff --git a/session.c b/session.c
-index 572487b4a..d36c1b702 100644
+index 105995f25..226bdfc81 100644
 --- a/session.c
 +++ b/session.c
 @@ -139,6 +139,7 @@ static int session_pty_req(struct ssh *, Session *);
@@ -1881,7 +1881,7 @@ index 572487b4a..d36c1b702 100644
  extern struct sshbuf *loginmsg;
  extern struct sshauthopt *auth_opts;
  extern char *tun_fwd_ifnames; /* serverloop.c */
-@@ -618,6 +619,14 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
+@@ -623,6 +624,14 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
  	/* Parent.  Close the slave side of the pseudo tty. */
  	close(ttyfd);
  
@@ -1896,7 +1896,7 @@ index 572487b4a..d36c1b702 100644
  	/* Enter interactive session. */
  	s->ptymaster = ptymaster;
  	session_set_fds(ssh, s, ptyfd, fdout, -1, 1, 1);
-@@ -708,15 +717,19 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -713,15 +722,19 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  	    s->self);
  
  #ifdef SSH_AUDIT_EVENTS
@@ -1918,7 +1918,7 @@ index 572487b4a..d36c1b702 100644
  #endif
  	if (s->ttyfd != -1)
  		ret = do_exec_pty(ssh, s, command);
-@@ -1502,7 +1515,11 @@ do_child(struct ssh *ssh, Session *s, const char *command)
+@@ -1507,7 +1520,11 @@ do_child(struct ssh *ssh, Session *s, const char *command)
  	sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id));
  
  	/* remove keys from memory */
@@ -1930,7 +1930,7 @@ index 572487b4a..d36c1b702 100644
  
  	/* Force a password change */
  	if (s->authctxt->force_pwchange) {
-@@ -1718,6 +1735,9 @@ session_unused(int id)
+@@ -1723,6 +1740,9 @@ session_unused(int id)
  	sessions[id].ttyfd = -1;
  	sessions[id].ptymaster = -1;
  	sessions[id].x11_chanids = NULL;
@@ -1940,7 +1940,7 @@ index 572487b4a..d36c1b702 100644
  	sessions[id].next_unused = sessions_first_unused;
  	sessions_first_unused = id;
  }
-@@ -1796,6 +1816,19 @@ session_open(Authctxt *authctxt, int chanid)
+@@ -1801,6 +1821,19 @@ session_open(Authctxt *authctxt, int chanid)
  	return 1;
  }
  
@@ -1960,7 +1960,7 @@ index 572487b4a..d36c1b702 100644
  Session *
  session_by_tty(char *tty)
  {
-@@ -2417,6 +2450,32 @@ session_exit_message(struct ssh *ssh, Session *s, int status)
+@@ -2422,6 +2455,32 @@ session_exit_message(struct ssh *ssh, Session *s, int status)
  		chan_write_failed(ssh, c);
  }
  
@@ -1993,7 +1993,7 @@ index 572487b4a..d36c1b702 100644
  void
  session_close(struct ssh *ssh, Session *s)
  {
-@@ -2430,6 +2489,10 @@ session_close(struct ssh *ssh, Session *s)
+@@ -2435,6 +2494,10 @@ session_close(struct ssh *ssh, Session *s)
  
  	if (s->ttyfd != -1)
  		session_pty_cleanup(s);
@@ -2004,7 +2004,7 @@ index 572487b4a..d36c1b702 100644
  	free(s->term);
  	free(s->display);
  	free(s->x11_chanids);
-@@ -2506,14 +2569,14 @@ session_close_by_channel(struct ssh *ssh, int id, int force, void *arg)
+@@ -2511,14 +2574,14 @@ session_close_by_channel(struct ssh *ssh, int id, int force, void *arg)
  }
  
  void
@@ -2021,7 +2021,7 @@ index 572487b4a..d36c1b702 100644
  			else
  				session_close(ssh, s);
  		}
-@@ -2639,6 +2702,15 @@ do_authenticated2(struct ssh *ssh, Authctxt *authctxt)
+@@ -2644,6 +2707,15 @@ do_authenticated2(struct ssh *ssh, Authctxt *authctxt)
  	server_loop2(ssh, authctxt);
  }
  
@@ -2037,7 +2037,7 @@ index 572487b4a..d36c1b702 100644
  void
  do_cleanup(struct ssh *ssh, Authctxt *authctxt)
  {
-@@ -2702,7 +2774,7 @@ do_cleanup(struct ssh *ssh, Authctxt *authctxt)
+@@ -2707,7 +2779,7 @@ do_cleanup(struct ssh *ssh, Authctxt *authctxt)
  	 * or if running in monitor.
  	 */
  	if (mm_is_monitor())
@@ -2078,7 +2078,7 @@ index 344a1ddf9..a41c6efcd 100644
  void	 session_close(struct ssh *, Session *);
  void	 do_setusercontext(struct passwd *);
 diff --git a/sshd-session.c b/sshd-session.c
-index 8a06616fd..0a9708d3a 100644
+index 7ecefff77..e206ec49a 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
 @@ -181,8 +181,8 @@ struct include_list includes = TAILQ_HEAD_INITIALIZER(includes);
@@ -2212,7 +2212,7 @@ index 8a06616fd..0a9708d3a 100644
  		}
  		/* Certs do not need demotion */
  	}
-@@ -413,7 +482,7 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
+@@ -398,7 +467,7 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
  		set_log_handler(mm_log_handler, pmonitor);
  
  	/* Demote the private keys to public keys. */
@@ -2221,7 +2221,7 @@ index 8a06616fd..0a9708d3a 100644
  
  	reseed_prngs();
  
-@@ -1336,6 +1405,9 @@ main(int ac, char **av)
+@@ -1323,6 +1392,9 @@ main(int ac, char **av)
  	do_authenticated(ssh, authctxt);
  
  	/* The connection has been terminated. */
@@ -2231,7 +2231,7 @@ index 8a06616fd..0a9708d3a 100644
  	ssh_packet_get_bytes(ssh, &ibytes, &obytes);
  	verbose("Transferred: sent %llu, received %llu bytes",
  	    (unsigned long long)obytes, (unsigned long long)ibytes);
-@@ -1381,6 +1453,16 @@ sshd_hostkey_sign(struct ssh *ssh, struct sshkey *privkey,
+@@ -1368,6 +1440,16 @@ sshd_hostkey_sign(struct ssh *ssh, struct sshkey *privkey,
  void
  cleanup_exit(int i)
  {
@@ -2248,7 +2248,7 @@ index 8a06616fd..0a9708d3a 100644
  	if (the_active_state != NULL && the_authctxt != NULL) {
  		do_cleanup(the_active_state, the_authctxt);
  		if (privsep_is_preauth &&
-@@ -1395,7 +1477,9 @@ cleanup_exit(int i)
+@@ -1382,7 +1464,9 @@ cleanup_exit(int i)
  	}
  #ifdef SSH_AUDIT_EVENTS
  	/* done after do_cleanup so it can cancel the PAM auth 'thread' */
@@ -2260,10 +2260,10 @@ index 8a06616fd..0a9708d3a 100644
  #endif
  	/* Override default fatal exit value when auth was attempted */
 diff --git a/sshd.c b/sshd.c
-index f66e1f86f..6b9847f67 100644
+index 32019a44f..06fe62467 100644
 --- a/sshd.c
 +++ b/sshd.c
-@@ -206,6 +206,15 @@ close_listen_socks(void)
+@@ -207,6 +207,15 @@ close_listen_socks(void)
  	num_listen_socks = 0;
  }
  
@@ -2279,7 +2279,7 @@ index f66e1f86f..6b9847f67 100644
  /* Allocate and initialise the children array */
  static void
  child_alloc(void)
-@@ -956,6 +965,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s,
+@@ -957,6 +966,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s,
  		if (received_sigterm) {
  			logit("Received signal %d; terminating.",
  			    (int) received_sigterm);
@@ -2288,5 +2288,5 @@ index f66e1f86f..6b9847f67 100644
  			if (options.pid_file != NULL)
  				unlink(options.pid_file);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0036-openssh-7.1p2-audit-race-condition.patch b/0036-openssh-7.1p2-audit-race-condition.patch
index 3fcbcce..9d7be87 100644
--- a/0036-openssh-7.1p2-audit-race-condition.patch
+++ b/0036-openssh-7.1p2-audit-race-condition.patch
@@ -1,4 +1,4 @@
-From 6991682335fb1dded7b50d903b7f9cc600535ba2 Mon Sep 17 00:00:00 2001
+From 069e1c8c675b7159653ef33a5897805130fa7d40 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 36/53] openssh-7.1p2-audit-race-condition
@@ -11,10 +11,10 @@ Subject: [PATCH 36/53] openssh-7.1p2-audit-race-condition
  3 files changed, 102 insertions(+), 7 deletions(-)
 
 diff --git a/monitor_wrap.c b/monitor_wrap.c
-index bdac7d3f9..4dc64857b 100644
+index 0f2a01920..a9251a075 100644
 --- a/monitor_wrap.c
 +++ b/monitor_wrap.c
-@@ -1396,4 +1396,50 @@ mm_audit_destroy_sensitive_data(struct ssh *ssh, const char *fp, pid_t pid, uid_
+@@ -1400,4 +1400,50 @@ mm_audit_destroy_sensitive_data(struct ssh *ssh, const char *fp, pid_t pid, uid_
  	mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_SERVER_KEY_FREE, m);
  	sshbuf_free(m);
  }
@@ -79,7 +79,7 @@ index 7f846f085..41e4b79fe 100644
  
  struct Session;
 diff --git a/session.c b/session.c
-index d36c1b702..bd8dc808c 100644
+index 226bdfc81..da116cada 100644
 --- a/session.c
 +++ b/session.c
 @@ -161,6 +161,10 @@ static Session *sessions = NULL;
@@ -93,7 +93,7 @@ index d36c1b702..bd8dc808c 100644
  static int is_child = 0;
  static int in_chroot = 0;
  static int have_dev_log = 1;
-@@ -359,6 +363,8 @@ xauth_valid_string(const char *s)
+@@ -364,6 +368,8 @@ xauth_valid_string(const char *s)
  	return 1;
  }
  
@@ -102,7 +102,7 @@ index d36c1b702..bd8dc808c 100644
  #define USE_PIPES 1
  /*
   * This is called to fork and execute a command when we have no tty.  This
-@@ -482,6 +488,8 @@ do_exec_no_pty(struct ssh *ssh, Session *s, const char *command)
+@@ -487,6 +493,8 @@ do_exec_no_pty(struct ssh *ssh, Session *s, const char *command)
  		close(err[0]);
  #endif
  
@@ -111,7 +111,7 @@ index d36c1b702..bd8dc808c 100644
  		/* Do processing for the child (exec command etc). */
  		do_child(ssh, s, command);
  		/* NOTREACHED */
-@@ -596,6 +604,9 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
+@@ -601,6 +609,9 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
  		/* Close the extra descriptor for the pseudo tty. */
  		close(ttyfd);
  
@@ -121,7 +121,7 @@ index d36c1b702..bd8dc808c 100644
  		/* record login, etc. similar to login(1) */
  #ifndef HAVE_OSF_SIA
  		do_login(ssh, s, command);
-@@ -730,6 +741,8 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -735,6 +746,8 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  	}
  	if (s->command != NULL && s->ptyfd == -1)
  		s->command_handle = mm_audit_run_command(ssh, s->command);
@@ -130,7 +130,7 @@ index d36c1b702..bd8dc808c 100644
  #endif
  	if (s->ttyfd != -1)
  		ret = do_exec_pty(ssh, s, command);
-@@ -745,6 +758,20 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
+@@ -750,6 +763,20 @@ do_exec(struct ssh *ssh, Session *s, const char *command)
  	 */
  	sshbuf_reset(loginmsg);
  
@@ -151,7 +151,7 @@ index d36c1b702..bd8dc808c 100644
  	return ret;
  }
  
-@@ -1497,6 +1524,33 @@ child_close_fds(struct ssh *ssh)
+@@ -1502,6 +1529,33 @@ child_close_fds(struct ssh *ssh)
  	log_redirect_stderr_to(NULL);
  }
  
@@ -185,7 +185,7 @@ index d36c1b702..bd8dc808c 100644
  /*
   * Performs common processing for the child, such as setting up the
   * environment, closing extra file descriptors, setting the user and group
-@@ -1514,13 +1568,6 @@ do_child(struct ssh *ssh, Session *s, const char *command)
+@@ -1519,13 +1573,6 @@ do_child(struct ssh *ssh, Session *s, const char *command)
  
  	sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id));
  
@@ -200,5 +200,5 @@ index d36c1b702..bd8dc808c 100644
  	if (s->authctxt->force_pwchange) {
  		do_setusercontext(pw);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0037-openssh-9.0p1-audit-log.patch b/0037-openssh-9.0p1-audit-log.patch
index 60cb439..e7921e4 100644
--- a/0037-openssh-9.0p1-audit-log.patch
+++ b/0037-openssh-9.0p1-audit-log.patch
@@ -1,4 +1,4 @@
-From bb3f0efad18c45bc7c131c6898c9bc87bcb50f55 Mon Sep 17 00:00:00 2001
+From c6fc191a070b13dbfec2eaedadf5fd32931d9b08 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 37/53] openssh-9.0p1-audit-log
@@ -262,5 +262,5 @@ index 45d66ccff..05ac132cf 100644
  void	audit_unsupported(struct ssh *, int);
  void	audit_kex(struct ssh *, int, char *, char *, char *, char *);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0038-openssh-7.7p1-fips.patch b/0038-openssh-7.7p1-fips.patch
index 04b6851..1dfc3a3 100644
--- a/0038-openssh-7.7p1-fips.patch
+++ b/0038-openssh-7.7p1-fips.patch
@@ -1,4 +1,4 @@
-From d57fef8fc7b2ad6426d58ab77fa5aa67172bdac0 Mon Sep 17 00:00:00 2001
+From 9417cd7d036883549aeab30e12f3eaa924421b1f Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 28 Aug 2025 14:01:38 +0200
 Subject: [PATCH 38/53] openssh-7.7p1-fips
@@ -126,7 +126,7 @@ index 2bc431223..8e9c621bd 100644
  			return 0;
  		}
 diff --git a/kex.c b/kex.c
-index 9ce2b7e12..7e50f277f 100644
+index d68ad2364..14a4a89b3 100644
 --- a/kex.c
 +++ b/kex.c
 @@ -37,6 +37,7 @@
@@ -147,7 +147,7 @@ index 9ce2b7e12..7e50f277f 100644
  	    "ext-info-s,kex-strict-s-v00@openssh.com" :
  	    "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL)
 diff --git a/kexgen.c b/kexgen.c
-index ff504580f..834073ef1 100644
+index c94048a26..32968e1f1 100644
 --- a/kexgen.c
 +++ b/kexgen.c
 @@ -31,6 +31,7 @@
@@ -190,7 +190,7 @@ index ff504580f..834073ef1 100644
  		break;
  	default:
  		r = SSH_ERR_INVALID_ARGUMENT;
-@@ -196,15 +212,30 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
+@@ -197,15 +213,30 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
  		break;
  #endif /* WITH_OPENSSL */
  	case KEX_C25519_SHA256:
@@ -226,7 +226,7 @@ index ff504580f..834073ef1 100644
  		break;
  	default:
  		r = SSH_ERR_INVALID_ARGUMENT;
-@@ -323,16 +354,31 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
+@@ -324,16 +355,31 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
  		break;
  #endif /* WITH_OPENSSL */
  	case KEX_C25519_SHA256:
@@ -265,7 +265,7 @@ index ff504580f..834073ef1 100644
  	default:
  		r = SSH_ERR_INVALID_ARGUMENT;
 diff --git a/kexgexc.c b/kexgexc.c
-index 1c2194a8f..2763e862a 100644
+index abd6bd99d..5fc0c4de7 100644
 --- a/kexgexc.c
 +++ b/kexgexc.c
 @@ -29,6 +29,7 @@
@@ -289,12 +289,12 @@ index 1c2194a8f..2763e862a 100644
  	if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0)
  		goto out;
 diff --git a/myproposal.h b/myproposal.h
-index a2a1f991e..f03293f35 100644
+index f4fb707c9..c4af330fc 100644
 --- a/myproposal.h
 +++ b/myproposal.h
-@@ -60,6 +60,18 @@
- 	"rsa-sha2-512," \
- 	"rsa-sha2-256" \
+@@ -62,6 +62,18 @@
+ 	"rsa-sha2-256," \
+ 	"ssh-mldsa44-ed25519"
  
 +#define	KEX_FIPS_PK_ALG	\
 +	"ecdsa-sha2-nistp256-cert-v01@openssh.com," \
@@ -311,7 +311,7 @@ index a2a1f991e..f03293f35 100644
  #define	KEX_SERVER_ENCRYPT \
  	"chacha20-poly1305@openssh.com," \
  	"aes128-gcm@openssh.com,aes256-gcm@openssh.com," \
-@@ -81,6 +93,27 @@
+@@ -83,6 +95,27 @@
  
  #define KEX_CLIENT_MAC KEX_SERVER_MAC
  
@@ -340,7 +340,7 @@ index a2a1f991e..f03293f35 100644
  #define	SSH_ALLOWED_CA_SIGALGS	\
  	"ssh-ed25519," \
 diff --git a/readconf.c b/readconf.c
-index 992c78866..2cbf1fcbd 100644
+index a07669754..f999a1df1 100644
 --- a/readconf.c
 +++ b/readconf.c
 @@ -38,6 +38,12 @@
@@ -356,7 +356,7 @@ index 992c78866..2cbf1fcbd 100644
  #include <util.h>
  #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS)
  # include <vis.h>
-@@ -3099,11 +3105,16 @@ fill_default_options(Options * options)
+@@ -3111,11 +3117,16 @@ fill_default_options(Options * options)
  	all_key = sshkey_alg_list(0, 0, 1, ',');
  	all_sig = sshkey_alg_list(0, 1, 1, ',');
  	/* remove unsupported algos from default lists */
@@ -379,7 +379,7 @@ index 992c78866..2cbf1fcbd 100644
  	do { \
  		if ((r = kex_assemble_names(&options->what, \
 diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
-index b65413c95..17e1cea72 100644
+index b8c0b6d64..d32f03b88 100644
 --- a/sandbox-seccomp-filter.c
 +++ b/sandbox-seccomp-filter.c
 @@ -258,6 +258,9 @@ static const struct sock_filter preauth_insns[] = {
@@ -393,7 +393,7 @@ index b65413c95..17e1cea72 100644
  	SC_DENY(__NR_openat, EACCES),
  #endif
 diff --git a/servconf.c b/servconf.c
-index 27147a1e7..846f5d212 100644
+index f241b39bd..a79958252 100644
 --- a/servconf.c
 +++ b/servconf.c
 @@ -38,7 +38,15 @@
@@ -412,7 +412,7 @@ index 27147a1e7..846f5d212 100644
  
  #include "xmalloc.h"
  #include "ssh.h"
-@@ -213,11 +221,16 @@ assemble_algorithms(ServerOptions *o)
+@@ -216,11 +224,16 @@ assemble_algorithms(ServerOptions *o)
  	all_key = sshkey_alg_list(0, 0, 1, ',');
  	all_sig = sshkey_alg_list(0, 1, 1, ',');
  	/* remove unsupported algos from default lists */
@@ -435,7 +435,7 @@ index 27147a1e7..846f5d212 100644
  	do { \
  		if ((r = kex_assemble_names(&o->what, defaults, all)) != 0) \
 diff --git a/ssh-ed25519.c b/ssh-ed25519.c
-index 8228f2830..668823ed2 100644
+index e8113e8e9..362f1a116 100644
 --- a/ssh-ed25519.c
 +++ b/ssh-ed25519.c
 @@ -24,6 +24,7 @@
@@ -446,19 +446,19 @@ index 8228f2830..668823ed2 100644
  
  #include "log.h"
  #include "sshbuf.h"
-@@ -163,6 +164,10 @@ ssh_ed25519_sign(struct sshkey *key,
- 	    key->ed25519_sk == NULL ||
- 	    datalen >= INT_MAX - crypto_sign_ed25519_BYTES)
+@@ -161,6 +162,10 @@ ssh_ed25519_sign(struct sshkey *key,
+ 	    sshkey_type_plain(key->type) != KEY_ED25519 ||
+ 	    key->ed25519_sk == NULL)
  		return SSH_ERR_INVALID_ARGUMENT;
 +	if (FIPS_mode()) {
 +	    logit_f("Ed25519 keys are not allowed in FIPS mode");
 +	    return SSH_ERR_INVALID_ARGUMENT;
 +	}
- 	smlen = slen = datalen + crypto_sign_ed25519_BYTES;
- 	if ((sig = malloc(slen)) == NULL)
- 		return SSH_ERR_ALLOC_FAIL;
-@@ -244,6 +249,10 @@ ssh_ed25519_verify(const struct sshkey *key,
- 	    dlen >= INT_MAX - crypto_sign_ed25519_BYTES ||
+ 
+ 	if ((ret = crypto_sign_ed25519_detached(sig, &siglen, data, datalen,
+ 	    key->ed25519_sk)) != 0 || siglen != sizeof(sig)) {
+@@ -236,6 +241,10 @@ ssh_ed25519_verify(const struct sshkey *key,
+ 	    key->ed25519_pk == NULL ||
  	    sig == NULL || siglen == 0)
  		return SSH_ERR_INVALID_ARGUMENT;
 +	if (FIPS_mode()) {
@@ -469,7 +469,7 @@ index 8228f2830..668823ed2 100644
  	if ((b = sshbuf_from(sig, siglen)) == NULL)
  		return SSH_ERR_ALLOC_FAIL;
 diff --git a/ssh-gss.h b/ssh-gss.h
-index a894e23c9..329dc9da0 100644
+index 9a05cdda1..5fc1a97e2 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
 @@ -88,6 +88,11 @@ extern char **k5users_allowed_cmds;
@@ -485,7 +485,7 @@ index a894e23c9..329dc9da0 100644
  
  typedef struct {
 diff --git a/ssh-keygen.c b/ssh-keygen.c
-index 6667a5c1b..ed1932ff0 100644
+index 5c2d645ac..f27b08915 100644
 --- a/ssh-keygen.c
 +++ b/ssh-keygen.c
 @@ -22,6 +22,7 @@
@@ -504,7 +504,7 @@ index 6667a5c1b..ed1932ff0 100644
  
  /*
   * Default number of bits in the RSA and ECDSA keys.  These value can be
-@@ -195,6 +197,10 @@ type_bits_valid(int type, const char *name, uint32_t *bitsp)
+@@ -198,6 +200,10 @@ type_bits_valid(int type, const char *name, uint32_t *bitsp)
  #endif
  	}
  #ifdef WITH_OPENSSL
@@ -515,7 +515,7 @@ index 6667a5c1b..ed1932ff0 100644
  	switch (type) {
  	case KEY_RSA:
  		if (*bitsp < SSH_RSA_MINIMUM_MODULUS_SIZE)
-@@ -243,7 +249,7 @@ ask_filename(struct passwd *pw, const char *prompt)
+@@ -246,7 +252,7 @@ ask_filename(struct passwd *pw, const char *prompt)
  	char *name = NULL;
  
  	if (key_type_name == NULL)
@@ -524,7 +524,7 @@ index 6667a5c1b..ed1932ff0 100644
  	else {
  		switch (sshkey_type_from_shortname(key_type_name)) {
  		case KEY_ECDSA_CERT:
-@@ -1048,9 +1054,17 @@ do_gen_all_hostkeys(struct passwd *pw)
+@@ -1087,9 +1093,17 @@ do_gen_all_hostkeys(struct passwd *pw)
  			first = 1;
  			printf("%s: generating new host keys: ", __progname);
  		}
@@ -543,7 +543,7 @@ index 6667a5c1b..ed1932ff0 100644
  		if ((fd = mkstemp(prv_tmp)) == -1) {
  			error("Could not save your private key in %s: %s",
  			    prv_tmp, strerror(errno));
-@@ -3792,7 +3806,7 @@ main(int argc, char **argv)
+@@ -3837,7 +3851,7 @@ main(int argc, char **argv)
  	}
  
  	if (key_type_name == NULL)
@@ -553,7 +553,7 @@ index 6667a5c1b..ed1932ff0 100644
  	type = sshkey_type_from_shortname(key_type_name);
  	type_bits_valid(type, key_type_name, &bits);
 diff --git a/ssh-keyscan.c b/ssh-keyscan.c
-index 77b4341c9..284d4deee 100644
+index bcfaa174a..3667ca581 100644
 --- a/ssh-keyscan.c
 +++ b/ssh-keyscan.c
 @@ -21,6 +21,7 @@
@@ -609,7 +609,7 @@ index ccadb14ca..5af39bb39 100644
  		goto out;
  	}
 diff --git a/ssh.c b/ssh.c
-index b9a59ca43..00c0edefc 100644
+index 6763e8934..323c5a1f9 100644
 --- a/ssh.c
 +++ b/ssh.c
 @@ -71,6 +71,7 @@
@@ -632,7 +632,7 @@ index b9a59ca43..00c0edefc 100644
  	if (options.sk_provider != NULL && *options.sk_provider == '$' &&
  	    strlen(options.sk_provider) > 1) {
 diff --git a/sshconnect2.c b/sshconnect2.c
-index 5459caa0c..244c725f7 100644
+index f6af0152a..0e7511e0b 100644
 --- a/sshconnect2.c
 +++ b/sshconnect2.c
 @@ -45,6 +45,10 @@
@@ -668,7 +668,7 @@ index 5459caa0c..244c725f7 100644
  			debug("Offering GSSAPI proposal: %s", gss);
  			xasprintf(&myproposal[PROPOSAL_KEX_ALGS],
 diff --git a/sshd.c b/sshd.c
-index 6b9847f67..ae26b10b3 100644
+index 06fe62467..ebc61a9d6 100644
 --- a/sshd.c
 +++ b/sshd.c
 @@ -43,6 +43,7 @@
@@ -693,7 +693,7 @@ index 6b9847f67..ae26b10b3 100644
  #ifdef HAVE_SECUREWARE
  #include <sys/security.h>
  #include <prot.h>
-@@ -1605,6 +1613,13 @@ main(int ac, char **av)
+@@ -1638,6 +1646,13 @@ main(int ac, char **av)
  		    r != SSH_ERR_SYSTEM_ERROR && !have_agent)
  			do_log2_r(r, ll, "Unable to load host key \"%s\"",
  			    options.host_key_files[i]);
@@ -707,7 +707,7 @@ index 6b9847f67..ae26b10b3 100644
  		if (sshkey_is_sk(key) &&
  		    key->sk_flags & SSH_SK_USER_PRESENCE_REQD) {
  			debug("host key %s requires user presence, ignoring",
-@@ -1829,6 +1844,10 @@ main(int ac, char **av)
+@@ -1862,6 +1877,10 @@ main(int ac, char **av)
  	/* Reinitialize the log (because of the fork above). */
  	log_init(__progname, options.log_level, options.log_facility, log_stderr);
  
@@ -719,7 +719,7 @@ index 6b9847f67..ae26b10b3 100644
  	 * Chdir to the root directory so that the current disk can be
  	 * unmounted if desired.
 diff --git a/sshkey.c b/sshkey.c
-index 7d1401a8f..2380c8081 100644
+index dd5171a2c..533b8ffa9 100644
 --- a/sshkey.c
 +++ b/sshkey.c
 @@ -36,6 +36,7 @@
@@ -738,7 +738,7 @@ index 7d1401a8f..2380c8081 100644
  #include "ssh-sk.h"
  #include "ssh-pkcs11.h"
  
-@@ -399,6 +401,18 @@ sshkey_alg_list(int certs_only, int plain_only, int include_sigonly, char sep)
+@@ -401,6 +403,18 @@ sshkey_alg_list(int certs_only, int plain_only, int include_sigonly, char sep)
  		impl = keyimpls[i];
  		if (impl->name == NULL || impl->type == KEY_NULL)
  			continue;
@@ -757,7 +757,7 @@ index 7d1401a8f..2380c8081 100644
  		if (!include_sigonly && impl->sigonly)
  			continue;
  		if ((certs_only && !impl->cert) || (plain_only && impl->cert))
-@@ -1427,6 +1441,20 @@ sshkey_read(struct sshkey *ret, char **cpp)
+@@ -1429,6 +1443,20 @@ sshkey_read(struct sshkey *ret, char **cpp)
  		return SSH_ERR_EC_CURVE_MISMATCH;
  	}
  
@@ -778,7 +778,7 @@ index 7d1401a8f..2380c8081 100644
  	/* Fill in ret from parsed key */
  	sshkey_free_contents(ret);
  	*ret = *k;
-@@ -2260,6 +2288,11 @@ sshkey_sign(struct sshkey *key,
+@@ -2294,6 +2322,11 @@ sshkey_sign(struct sshkey *key,
  		*lenp = 0;
  	if (datalen > SSH_KEY_MAX_SIGN_DATA_SIZE)
  		return SSH_ERR_INVALID_ARGUMENT;
@@ -790,7 +790,7 @@ index 7d1401a8f..2380c8081 100644
  	if ((impl = sshkey_impl_from_key(key)) == NULL)
  		return SSH_ERR_KEY_TYPE_UNKNOWN;
  	if ((r = sshkey_unshield_private(key)) != 0)
-@@ -2299,6 +2332,10 @@ sshkey_verify(const struct sshkey *key,
+@@ -2333,6 +2366,10 @@ sshkey_verify(const struct sshkey *key,
  		*detailsp = NULL;
  	if (siglen == 0 || dlen > SSH_KEY_MAX_SIGN_DATA_SIZE)
  		return SSH_ERR_INVALID_ARGUMENT;
@@ -802,5 +802,5 @@ index 7d1401a8f..2380c8081 100644
  		return SSH_ERR_KEY_TYPE_UNKNOWN;
  	return impl->funcs->verify(key, sig, siglen, data, dlen,
 -- 
-2.55.0
+2.56.0
 

diff --git a/0039-openssh-8.7p1-negotiate-supported-algs.patch b/0039-openssh-8.7p1-negotiate-supported-algs.patch
index fbdd62d..f1bd4f1 100644
--- a/0039-openssh-8.7p1-negotiate-supported-algs.patch
+++ b/0039-openssh-8.7p1-negotiate-supported-algs.patch
@@ -1,4 +1,4 @@
-From 5e5ea62ca23bdce9f3cad2ea11c8f053faeb42ee Mon Sep 17 00:00:00 2001
+From 6f1d20630d0b07ff213fa91b55748fd6cf4f0856 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 39/53] openssh-8.7p1-negotiate-supported-algs
@@ -113,7 +113,7 @@ index 58004b80e..036a7c2b9 100644
 +	    fail "ssh connect failed for keytype $keytype"
  done
 diff --git a/sshconnect2.c b/sshconnect2.c
-index 244c725f7..c21b3a11a 100644
+index 0e7511e0b..da15bddcc 100644
 --- a/sshconnect2.c
 +++ b/sshconnect2.c
 @@ -224,7 +224,7 @@ ssh_kex2(struct ssh *ssh, char *host, struct sockaddr_storage *hostaddr,
@@ -158,5 +158,5 @@ index 244c725f7..c21b3a11a 100644
  	/* start key exchange */
  	if ((r = kex_setup(ssh, myproposal)) != 0)
 -- 
-2.55.0
+2.56.0
 

diff --git a/0040-openssh-9.0p1-evp-fips-kex.patch b/0040-openssh-9.0p1-evp-fips-kex.patch
index 8ad50ff..668a0ac 100644
--- a/0040-openssh-9.0p1-evp-fips-kex.patch
+++ b/0040-openssh-9.0p1-evp-fips-kex.patch
@@ -1,4 +1,4 @@
-From 162e99b9189796fad6327148d8c6817d5ee74c18 Mon Sep 17 00:00:00 2001
+From 224219820fa66356917a648fdf90e660dd041304 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 40/53] openssh-9.0p1-evp-fips-kex
@@ -140,10 +140,10 @@ index 3efe0a69f..bf324309c 100644
  
  DH *
 diff --git a/kex.c b/kex.c
-index 7e50f277f..62cfa86cd 100644
+index 14a4a89b3..fea02669c 100644
 --- a/kex.c
 +++ b/kex.c
-@@ -1622,3 +1622,142 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms,
+@@ -1657,3 +1657,142 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms,
  	return r;
  }
  
@@ -287,7 +287,7 @@ index 7e50f277f..62cfa86cd 100644
 +}
 +#endif /* WITH_OPENSSL */
 diff --git a/kex.h b/kex.h
-index 8f9934899..1fe4bb29b 100644
+index dc5b4d5d0..158355a9b 100644
 --- a/kex.h
 +++ b/kex.h
 @@ -38,6 +38,9 @@
@@ -300,7 +300,7 @@ index 8f9934899..1fe4bb29b 100644
  #else /* OPENSSL */
  #define BIGNUM		void
  #define DH		void
-@@ -322,6 +325,9 @@ int	kexc25519_shared_key_ext(const u_char key[CURVE25519_SIZE],
+@@ -327,6 +330,9 @@ int	kexc25519_shared_key_ext(const u_char key[CURVE25519_SIZE],
      const u_char pub[CURVE25519_SIZE], struct sshbuf *out, int)
  	__attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
  	__attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));
@@ -610,5 +610,5 @@ index a9dbf5c4b..38d827b4c 100644
  	return r;
  }
 -- 
-2.55.0
+2.56.0
 

diff --git a/0041-openssh-8.7p1-nohostsha1proof.patch b/0041-openssh-8.7p1-nohostsha1proof.patch
index dc39983..a45d90c 100644
--- a/0041-openssh-8.7p1-nohostsha1proof.patch
+++ b/0041-openssh-8.7p1-nohostsha1proof.patch
@@ -1,4 +1,4 @@
-From 8555dd3916d311cbef5bff785523cd27a193c720 Mon Sep 17 00:00:00 2001
+From df77d50fd29fa47b14681341232b24e1b42daee9 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 41/53] openssh-8.7p1-nohostsha1proof
@@ -65,7 +65,7 @@ index 1a19060fc..2e6db5bf9 100644
  /* #define unused		0x00000020 */
  #define SSH_BUG_DEBUG		0x00000040
 diff --git a/monitor.c b/monitor.c
-index 733a3460f..8269e78c3 100644
+index 3ae9705c3..71d11a679 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -741,11 +741,18 @@ int
@@ -296,10 +296,10 @@ index 5af39bb39..88232c6ed 100644
  			goto out;
  		}
 diff --git a/sshconnect2.c b/sshconnect2.c
-index c21b3a11a..3660873a6 100644
+index da15bddcc..c18d4872e 100644
 --- a/sshconnect2.c
 +++ b/sshconnect2.c
-@@ -1440,6 +1440,14 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
+@@ -1446,6 +1446,14 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
  			retried = 1;
  			goto retry_pin;
  		}
@@ -315,10 +315,10 @@ index c21b3a11a..3660873a6 100644
  	}
  
 diff --git a/sshd-session.c b/sshd-session.c
-index 0a9708d3a..adf5b1b49 100644
+index e206ec49a..d7168f80a 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -1261,6 +1261,27 @@ main(int ac, char **av)
+@@ -1247,6 +1247,27 @@ main(int ac, char **av)
  
  	check_ip_options(ssh);
  
@@ -347,5 +347,5 @@ index 0a9708d3a..adf5b1b49 100644
  	channel_init_channels(ssh);
  	channel_set_af(ssh, options.address_family);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0042-openssh-9.9p1-separate-keysign.patch b/0042-openssh-9.9p1-separate-keysign.patch
index c267e9e..f8731da 100644
--- a/0042-openssh-9.9p1-separate-keysign.patch
+++ b/0042-openssh-9.9p1-separate-keysign.patch
@@ -1,4 +1,4 @@
-From e9eba7f4adb59d308ff9dec4f8ec1a426cfe3e39 Mon Sep 17 00:00:00 2001
+From 8f5a3dbf908afab34dc3e4f0fb94e783b810b5b2 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 42/53] openssh-9.9p1-separate-keysign
@@ -8,7 +8,7 @@ Subject: [PATCH 42/53] openssh-9.9p1-separate-keysign
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/ssh_config.5 b/ssh_config.5
-index c4c72f587..f2ff8585c 100644
+index a003e37b8..a4fbecf35 100644
 --- a/ssh_config.5
 +++ b/ssh_config.5
 @@ -834,7 +834,7 @@ or
@@ -21,5 +21,5 @@ index c4c72f587..f2ff8585c 100644
  Sets the escape character (default:
  .Ql ~ ) .
 -- 
-2.55.0
+2.56.0
 

diff --git a/0043-openssh-9.9p1-openssl-mlkem.patch b/0043-openssh-9.9p1-openssl-mlkem.patch
index 8ffc1c7..4895c33 100644
--- a/0043-openssh-9.9p1-openssl-mlkem.patch
+++ b/0043-openssh-9.9p1-openssl-mlkem.patch
@@ -1,4 +1,4 @@
-From 648348f34e3f4279e030184a318a9c0326fd82a1 Mon Sep 17 00:00:00 2001
+From fc3fc20d8fe4ecb76d625bc5e52c775fbc63fb56 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:29 +0200
 Subject: [PATCH 43/53] openssh-9.9p1-openssl-mlkem
@@ -398,5 +398,5 @@ index e2c2c0a86..36658120f 100644
  #else /* USE_MLKEM768X25519 */
  int
 -- 
-2.55.0
+2.56.0
 

diff --git a/0044-openssh-9.9p2-error_processing.patch b/0044-openssh-9.9p2-error_processing.patch
index dc7f1eb..2f7df99 100644
--- a/0044-openssh-9.9p2-error_processing.patch
+++ b/0044-openssh-9.9p2-error_processing.patch
@@ -1,4 +1,4 @@
-From 876a71d2fa9c9eea5b4263216413e9f3864956d2 Mon Sep 17 00:00:00 2001
+From 50aac8bc7ee285b84b4b4b5ca09177ebcb421b65 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Fri, 16 May 2025 14:53:54 +0200
 Subject: [PATCH 44/53] openssh-9.9p2-error_processing
@@ -9,10 +9,10 @@ Subject: [PATCH 44/53] openssh-9.9p2-error_processing
  1 file changed, 2 insertions(+)
 
 diff --git a/ssh-agent.c b/ssh-agent.c
-index 1604f540a..4c8e1a4da 100644
+index 9951345dd..f08f7c3b1 100644
 --- a/ssh-agent.c
 +++ b/ssh-agent.c
-@@ -1359,6 +1359,8 @@ process_add_identity(SocketEntry *e)
+@@ -1361,6 +1361,8 @@ process_add_identity(SocketEntry *e)
  	if ((r = sshkey_private_deserialize(e->request, &k)) != 0 ||
  	    k == NULL ||
  	    (r = sshbuf_get_cstring(e->request, &comment, NULL)) != 0) {
@@ -22,5 +22,5 @@ index 1604f540a..4c8e1a4da 100644
  		goto out;
  	}
 -- 
-2.55.0
+2.56.0
 

diff --git a/0045-Ignore-bad-hostkeys-in-known_hosts-file.patch b/0045-Ignore-bad-hostkeys-in-known_hosts-file.patch
index e73e923..a8acb68 100644
--- a/0045-Ignore-bad-hostkeys-in-known_hosts-file.patch
+++ b/0045-Ignore-bad-hostkeys-in-known_hosts-file.patch
@@ -1,4 +1,4 @@
-From e864b54e074914b1bdc2a239d02b9cabc97e9ca4 Mon Sep 17 00:00:00 2001
+From 0cc83d529914b43353f9fb6d6cb14d12c3f1cfa8 Mon Sep 17 00:00:00 2001
 From: Zoltan Fridrich <zfridric@redhat.com>
 Date: Mon, 5 May 2025 11:52:25 +0200
 Subject: [PATCH 45/53] Ignore bad hostkeys in known_hosts file
@@ -64,7 +64,7 @@ index a24a4e329..0e9b1a19a 100644
  
  #endif
 diff --git a/ssh.c b/ssh.c
-index 00c0edefc..0182cc567 100644
+index 323c5a1f9..68c16c79c 100644
 --- a/ssh.c
 +++ b/ssh.c
 @@ -97,6 +97,7 @@
@@ -84,5 +84,5 @@ index 00c0edefc..0182cc567 100644
  		fatal("Invalid number of ConnectionAttempts");
  
 -- 
-2.55.0
+2.56.0
 

diff --git a/0046-support-authentication-indicators-in-GSSAPI.patch b/0046-support-authentication-indicators-in-GSSAPI.patch
index 01d460b..7493b1d 100644
--- a/0046-support-authentication-indicators-in-GSSAPI.patch
+++ b/0046-support-authentication-indicators-in-GSSAPI.patch
@@ -1,4 +1,4 @@
-From 5348ff4f4c59dac677b8348b1213c6ef1e530e31 Mon Sep 17 00:00:00 2001
+From 12f718a27b18fee507b28959c942f8fe3f84efa3 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Sun, 12 Apr 2026 12:23:51 +0200
 Subject: [PATCH 46/53] support authentication indicators in GSSAPI
@@ -8,19 +8,19 @@ https://github.com/openssh/openssh-portable/pull/500
 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
 ---
  configure.ac    |   1 +
- gss-serv-krb5.c |  89 ++++++++++++++++++++++++++++++++++----
- gss-serv.c      | 112 ++++++++++++++++++++++++++++++++++++++++++++++--
+ gss-serv-krb5.c |  89 +++++++++++++++++++++++++++++++++++----
+ gss-serv.c      | 108 +++++++++++++++++++++++++++++++++++++++++++++++-
  servconf.c      |  11 +++++
  servconf.h      |   6 ++-
- ssh-gss.h       |   7 +++
- sshd_config.5   |  46 ++++++++++++++++++++
- 7 files changed, 258 insertions(+), 14 deletions(-)
+ ssh-gss.h       |   7 ++++
+ sshd_config.5   |  46 +++++++++++++++++++++
+ 7 files changed, 256 insertions(+), 12 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 394acc3d8..d6274328b 100644
+index 831b611bd..e850041fb 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -5059,6 +5059,7 @@ AC_ARG_WITH([kerberos5],
+@@ -5068,6 +5068,7 @@ AC_ARG_WITH([kerberos5],
  		AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
  		AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h])
  		AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h])
@@ -161,15 +161,15 @@ index 723509409..fc7cabc09 100644
  	return retval;
  }
 diff --git a/gss-serv.c b/gss-serv.c
-index 6eb7d2163..237a3c40a 100644
+index 5bc31289e..66d92e4fe 100644
 --- a/gss-serv.c
 +++ b/gss-serv.c
 @@ -55,7 +55,7 @@ extern ServerOptions options;
  
  static ssh_gssapi_client gssapi_client =
-     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, GSS_C_NO_CREDENTIAL,
--    GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0};
-+    GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, NULL};
+     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
+-    GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, 0};
++    GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, 0, NULL};
  
  ssh_gssapi_mech gssapi_null_mech =
      { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL, NULL};
@@ -273,7 +273,7 @@ index 6eb7d2163..237a3c40a 100644
  /* Extract the client details from a given context. This can only reliably
   * be called once for a context */
  
-@@ -386,6 +479,12 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+@@ -387,6 +480,12 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
  	}
  
  	gss_release_buffer(&ctx->minor, &ename);
@@ -286,44 +286,37 @@ index 6eb7d2163..237a3c40a 100644
  
  	/* We can't copy this structure, so we just move the pointer to it */
  	client->creds = ctx->client_creds;
-@@ -453,6 +552,7 @@ int
- ssh_gssapi_userok(char *user, struct passwd *pw, int kex)
+@@ -458,10 +557,17 @@ void
+ ssh_gssapi_cleanup_global_client()
  {
  	OM_uint32 lmin;
 +	size_t i;
  
- 	(void) kex; /* used in privilege separation */
- 
-@@ -471,8 +571,14 @@ ssh_gssapi_userok(char *user, struct passwd *pw, int kex)
- 			gss_release_buffer(&lmin, &gssapi_client.displayname);
- 			gss_release_buffer(&lmin, &gssapi_client.exportedname);
- 			gss_release_cred(&lmin, &gssapi_client.creds);
--			explicit_bzero(&gssapi_client,
--			    sizeof(ssh_gssapi_client));
-+
-+			if (gssapi_client.indicators != NULL) {
-+				for (i = 0; gssapi_client.indicators[i] != NULL; i++)
-+					free(gssapi_client.indicators[i]);
-+				free(gssapi_client.indicators);
-+			}
+ 	gss_release_buffer(&lmin, &gssapi_client.displayname);
+ 	gss_release_buffer(&lmin, &gssapi_client.exportedname);
+ 	gss_release_cred(&lmin, &gssapi_client.creds);
 +
-+			explicit_bzero(&gssapi_client, sizeof(ssh_gssapi_client));
- 			return 0;
- 		}
- 	else
++	if (gssapi_client.indicators != NULL) {
++		for (i = 0; gssapi_client.indicators[i] != NULL; i++)
++			free(gssapi_client.indicators[i]);
++		free(gssapi_client.indicators);
++	}
+ 	explicit_bzero(&gssapi_client, sizeof(ssh_gssapi_client));
+ }
+ 
 diff --git a/servconf.c b/servconf.c
-index 846f5d212..d9cccc17c 100644
+index a79958252..0d55461e6 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -456,6 +456,7 @@ fill_default_server_options(ServerOptions *options)
- 	CLEAR_ON_NONE(options->routing_domain);
+@@ -478,6 +478,7 @@ fill_default_server_options(ServerOptions *options)
  	CLEAR_ON_NONE(options->host_key_agent);
  	CLEAR_ON_NONE(options->per_source_penalty_exempt);
+ 	CLEAR_ON_NONE(options->agent_socket_path);
 +	CLEAR_ON_NONE(options->gss_indicators);
  
  	for (i = 0; i < options->num_host_key_files; i++)
  		CLEAR_ON_NONE(options->host_key_files[i]);
-@@ -1488,6 +1489,15 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1537,6 +1538,15 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		if (*activep && options->gss_kex_algorithms == NULL)
  			options->gss_kex_algorithms = xstrdup(arg);
  		break;
@@ -339,7 +332,7 @@ index 846f5d212..d9cccc17c 100644
  #endif /* GSSAPI */
  
  	case sPasswordAuthentication:
-@@ -4274,6 +4284,7 @@ dump_config(ServerOptions *o)
+@@ -4404,6 +4414,7 @@ dump_config(ServerOptions *o)
  	dump_cfg_fmtint(sGSSAPIStrictAcceptorCheck, o->gss_strict_acceptor);
  	dump_cfg_fmtint(sGSSAPIStoreCredentialsOnRekey, o->gss_store_rekey);
  	dump_cfg_string(sGSSAPIKexAlgorithms, o->gss_kex_algorithms);
@@ -348,10 +341,10 @@ index 846f5d212..d9cccc17c 100644
  	dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
  	dump_cfg_fmtint(sKbdInteractiveAuthentication,
 diff --git a/servconf.h b/servconf.h
-index c55b64c73..81e699655 100644
+index f6d1ecf09..31425c4b2 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -326,7 +326,8 @@ SSHCONF_INTFLAG(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_GLOBAL, 1
+@@ -333,7 +333,8 @@ SSHCONF_INTFLAG(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_GLOBAL, 1
  SSHCONF_INTFLAG(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
  SSHCONF_STRING(gss_kex_algorithms, GSSAPIKexAlgorithms, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
@@ -361,7 +354,7 @@ index c55b64c73..81e699655 100644
  #else /* GSSAPI */
  #define SSHD_CONFIG_ENTRIES_GSS \
  SSHCONF_UNSUPPORTED_INT(gss_authentication, GSSAPIAuthentication, SSHCFG_ALL) \
-@@ -336,7 +337,8 @@ SSHCONF_UNSUPPORTED_INT(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_G
+@@ -343,7 +344,8 @@ SSHCONF_UNSUPPORTED_INT(gss_strict_acceptor, GSSAPIStrictAcceptorCheck, SSHCFG_G
  SSHCONF_UNSUPPORTED_INT(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_STRING(gss_kex_algorithms, GSSAPIKexAlgorithms, SSHCFG_GLOBAL) \
@@ -372,7 +365,7 @@ index c55b64c73..81e699655 100644
  
  #define SSHD_CONFIG_ENTRIES \
 diff --git a/ssh-gss.h b/ssh-gss.h
-index 329dc9da0..1506719a9 100644
+index 5fc1a97e2..e67700417 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
 @@ -34,6 +34,12 @@
@@ -388,8 +381,8 @@ index 329dc9da0..1506719a9 100644
  #ifdef KRB5
  # ifndef HEIMDAL
  #  ifdef HAVE_GSSAPI_GENERIC_H
-@@ -112,6 +118,7 @@ typedef struct {
- 	ssh_gssapi_ccache store;
+@@ -113,6 +119,7 @@ typedef struct {
+ 	int userok;
  	int used;
  	int updated;
 +	char **indicators; /* auth indicators */
@@ -397,10 +390,10 @@ index 329dc9da0..1506719a9 100644
  
  typedef struct ssh_gssapi_mech_struct {
 diff --git a/sshd_config.5 b/sshd_config.5
-index b72757895..2a8f3abea 100644
+index a2f87b0c0..3ae479eda 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -811,6 +811,52 @@ This option only applies to connections using GSSAPI.
+@@ -837,6 +837,52 @@ This option only applies to connections using GSSAPI.
  .Pp
  The list of supported key exchange algorithms may also be obtained using
  .Qq ssh -Q GSSAPIKexAlgorithms .
@@ -454,5 +447,5 @@ index b72757895..2a8f3abea 100644
  The default is handled system-wide by
  .Xr crypto-policies 7 .
 -- 
-2.55.0
+2.56.0
 

diff --git a/0047-NIST-curves-hybrid-KEX-implementation.patch b/0047-NIST-curves-hybrid-KEX-implementation.patch
index 6885241..c64976b 100644
--- a/0047-NIST-curves-hybrid-KEX-implementation.patch
+++ b/0047-NIST-curves-hybrid-KEX-implementation.patch
@@ -1,4 +1,4 @@
-From 111be4b2ba5e0e2549d21d1ed4c53fe9af90827a Mon Sep 17 00:00:00 2001
+From ba13f7f17189c53dc2d4518b3d217124892671ce Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 20 Oct 2025 16:07:31 +0200
 Subject: [PATCH 47/53] NIST curves hybrid KEX implementation
@@ -81,7 +81,7 @@ index 2e6db5bf9..b78e55b69 100644
 +int is_mlkem768_available(void);
  #endif
 diff --git a/crypto_api.h b/crypto_api.h
-index f8441ed6f..60ea24a3e 100644
+index 4def46ba5..b19ea8699 100644
 --- a/crypto_api.h
 +++ b/crypto_api.h
 @@ -203,6 +203,11 @@ int crypto_sign_mldsa44_ed25519_verify(const uint8_t sig[MLDSA44_ED25519_SIG_SZ]
@@ -249,10 +249,10 @@ index cdd5db90e..f9c51429a 100644
  				error("Unsupported KEX algorithm \"%.100s\"", p);
  			free(s);
 diff --git a/kex.c b/kex.c
-index 62cfa86cd..1e0c29b91 100644
+index fea02669c..102745e37 100644
 --- a/kex.c
 +++ b/kex.c
-@@ -760,6 +760,7 @@ kex_free(struct kex *kex)
+@@ -795,6 +795,7 @@ kex_free(struct kex *kex)
  #ifdef WITH_OPENSSL
  	DH_free(kex->dh);
  	EC_KEY_free(kex->ec_client_key);
@@ -261,7 +261,7 @@ index 62cfa86cd..1e0c29b91 100644
  	for (mode = 0; mode < MODE_MAX; mode++) {
  		kex_free_newkeys(kex->newkeys[mode]);
 diff --git a/kex.h b/kex.h
-index 1fe4bb29b..4e1b2875e 100644
+index 158355a9b..4d2e52a5d 100644
 --- a/kex.h
 +++ b/kex.h
 @@ -65,7 +65,8 @@
@@ -284,7 +284,7 @@ index 1fe4bb29b..4e1b2875e 100644
  #ifdef GSSAPI
  	KEX_GSS_GRP1_SHA1,
  	KEX_GSS_GRP14_SHA1,
-@@ -207,6 +209,9 @@ struct kex {
+@@ -210,6 +212,9 @@ struct kex {
  	u_char sntrup761_client_key[crypto_kem_sntrup761_SECRETKEYBYTES]; /* KEM */
  	u_char mlkem768_client_key[crypto_kem_mlkem768_SECRETKEYBYTES]; /* KEM */
  	struct sshbuf *client_pub;
@@ -294,7 +294,7 @@ index 1fe4bb29b..4e1b2875e 100644
  };
  
  int	 kex_name_valid(const char *);
-@@ -297,6 +302,17 @@ int	 kex_kem_mlkem768ecdh_enc(struct kex *, const struct sshbuf *,
+@@ -302,6 +307,17 @@ int	 kex_kem_mlkem768ecdh_enc(struct kex *, const struct sshbuf *,
      struct sshbuf **, struct sshbuf **);
  int	 kex_kem_mlkem768ecdh_dec(struct kex *, const struct sshbuf *,
      struct sshbuf **);
@@ -313,7 +313,7 @@ index 1fe4bb29b..4e1b2875e 100644
  int	 kex_dh_keygen(struct kex *);
  int	 kex_dh_compute_key(struct kex *, BIGNUM *, struct sshbuf *);
 diff --git a/kexgen.c b/kexgen.c
-index 834073ef1..79ddb5925 100644
+index 32968e1f1..d3d8ac93e 100644
 --- a/kexgen.c
 +++ b/kexgen.c
 @@ -114,9 +114,6 @@ kex_gen_client(struct ssh *ssh)
@@ -353,7 +353,7 @@ index 834073ef1..79ddb5925 100644
  	default:
  		r = SSH_ERR_INVALID_ARGUMENT;
  		break;
-@@ -206,10 +215,6 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
+@@ -207,10 +216,6 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
  	case KEX_ECDH_SHA2:
  		r = kex_ecdh_dec(kex, server_blob, &shared_secret);
  		break;
@@ -364,7 +364,7 @@ index 834073ef1..79ddb5925 100644
  #endif /* WITH_OPENSSL */
  	case KEX_C25519_SHA256:
  		if (FIPS_mode()) {
-@@ -230,13 +235,28 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
+@@ -231,13 +236,28 @@ input_kex_gen_reply(int type, uint32_t seq, struct ssh *ssh)
  		break;
  	case KEX_KEM_MLKEM768X25519_SHA256:
  		if (FIPS_mode()) {
@@ -395,7 +395,7 @@ index 834073ef1..79ddb5925 100644
  	default:
  		r = SSH_ERR_INVALID_ARGUMENT;
  		break;
-@@ -290,6 +310,8 @@ out:
+@@ -291,6 +311,8 @@ out:
  	    sizeof(kex->sntrup761_client_key));
  	explicit_bzero(kex->mlkem768_client_key,
  	    sizeof(kex->mlkem768_client_key));
@@ -404,7 +404,7 @@ index 834073ef1..79ddb5925 100644
  	sshbuf_free(server_host_key_blob);
  	free(signature);
  	sshbuf_free(tmp);
-@@ -348,10 +370,6 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
+@@ -349,10 +371,6 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
  		r = kex_ecdh_enc(kex, client_pubkey, &server_pubkey,
  		    &shared_secret);
  		break;
@@ -415,7 +415,7 @@ index 834073ef1..79ddb5925 100644
  #endif /* WITH_OPENSSL */
  	case KEX_C25519_SHA256:
  		if (FIPS_mode()) {
-@@ -373,13 +391,28 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
+@@ -374,13 +392,28 @@ input_kex_gen_init(int type, uint32_t seq, struct ssh *ssh)
  		break;
  	case KEX_KEM_MLKEM768X25519_SHA256:
  		if (FIPS_mode()) {
@@ -1227,7 +1227,7 @@ index 36658120f..03efb788f 100644
 +
  #endif /* USE_MLKEM768X25519 */
 diff --git a/monitor.c b/monitor.c
-index 8269e78c3..87df3e9d7 100644
+index 71d11a679..c3d8ff2d9 100644
 --- a/monitor.c
 +++ b/monitor.c
 @@ -2034,6 +2034,8 @@ monitor_apply_keystate(struct ssh *ssh, struct monitor *pmonitor)
@@ -1240,7 +1240,7 @@ index 8269e78c3..87df3e9d7 100644
  	kex->load_host_private_key=&get_hostkey_private_by_type;
  	kex->host_key_index=&get_hostkey_index;
 diff --git a/myproposal.h b/myproposal.h
-index f03293f35..db50c5b1c 100644
+index c4af330fc..6c9045a89 100644
 --- a/myproposal.h
 +++ b/myproposal.h
 @@ -26,6 +26,8 @@
@@ -1252,7 +1252,7 @@ index f03293f35..db50c5b1c 100644
  	"sntrup761x25519-sha512," \
  	"sntrup761x25519-sha512@openssh.com," \
  	"curve25519-sha256," \
-@@ -99,6 +101,8 @@
+@@ -101,6 +103,8 @@
  	"aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
  	"aes128-gcm@openssh.com,aes256-gcm@openssh.com"
  #define KEX_DEFAULT_KEX_FIPS		\
@@ -1284,7 +1284,7 @@ index db7cb418b..fad9a634a 100644
  # ifdef USE_SNTRUP761X25519
  	do_kex("sntrup761x25519-sha512");
 diff --git a/ssh-keyscan.c b/ssh-keyscan.c
-index 284d4deee..405faf167 100644
+index 3667ca581..b00d7ba08 100644
 --- a/ssh-keyscan.c
 +++ b/ssh-keyscan.c
 @@ -307,7 +307,8 @@ keygrab_ssh2(con *c)
@@ -1322,7 +1322,7 @@ index d01ac5483..f554b12cd 100644
  	}
  	*sshp = ssh;
 diff --git a/sshconnect2.c b/sshconnect2.c
-index 3660873a6..b5d63e599 100644
+index c18d4872e..20d7622a7 100644
 --- a/sshconnect2.c
 +++ b/sshconnect2.c
 @@ -349,7 +349,8 @@ ssh_kex2(struct ssh *ssh, char *host, struct sockaddr_storage *hostaddr,
@@ -1336,10 +1336,10 @@ index 3660873a6..b5d63e599 100644
  
  #if defined(GSSAPI) && defined(WITH_OPENSSL)
 diff --git a/sshd-auth.c b/sshd-auth.c
-index 079063f47..6038758ce 100644
+index c7c4a88f6..80fc024c3 100644
 --- a/sshd-auth.c
 +++ b/sshd-auth.c
-@@ -864,6 +864,8 @@ do_ssh2_kex(struct ssh *ssh)
+@@ -867,6 +867,8 @@ do_ssh2_kex(struct ssh *ssh)
  	kex->kex[KEX_C25519_SHA256] = kex_gen_server;
  	kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
  	kex->kex[KEX_KEM_MLKEM768X25519_SHA256] = kex_gen_server;
@@ -1349,5 +1349,5 @@ index 079063f47..6038758ce 100644
  	kex->load_host_private_key=&get_hostkey_private_by_type;
  	kex->host_key_index=&get_hostkey_index;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0048-openssh-7.3p1-x11-max-displays.patch b/0048-openssh-7.3p1-x11-max-displays.patch
index c385586..10a3ef6 100644
--- a/0048-openssh-7.3p1-x11-max-displays.patch
+++ b/0048-openssh-7.3p1-x11-max-displays.patch
@@ -1,4 +1,4 @@
-From 9e952349b6b64ff2916199323b1db909c3f1d6f3 Mon Sep 17 00:00:00 2001
+From e390af2fd555754b9c311e8369fad452c22ade8b Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Fri, 12 Dec 2025 15:35:14 +0100
 Subject: [PATCH 48/53] openssh-7.3p1-x11-max-displays
@@ -14,10 +14,10 @@ Move MAX_DISPLAYS to a configuration option (#1341302)
  6 files changed, 24 insertions(+), 6 deletions(-)
 
 diff --git a/channels.c b/channels.c
-index bae84e5f9..48ec0ab83 100644
+index a8e77e2b5..5b1b11fd3 100644
 --- a/channels.c
 +++ b/channels.c
-@@ -5085,7 +5085,7 @@ rdynamic_connect_finish(struct ssh *ssh, Channel *c)
+@@ -5142,7 +5142,7 @@ rdynamic_connect_finish(struct ssh *ssh, Channel *c)
   */
  int
  x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
@@ -26,7 +26,7 @@ index bae84e5f9..48ec0ab83 100644
      u_int *display_numberp, int **chanids)
  {
  	Channel *nc = NULL;
-@@ -5098,8 +5098,11 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
+@@ -5155,8 +5155,11 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
  	    x11_display_offset > UINT16_MAX - X11_BASE_PORT - MAX_DISPLAYS)
  		return -1;
  
@@ -39,7 +39,7 @@ index bae84e5f9..48ec0ab83 100644
  	    display_number++) {
  		port = X11_BASE_PORT + display_number;
  		memset(&hints, 0, sizeof(hints));
-@@ -5164,7 +5167,7 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
+@@ -5221,7 +5224,7 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset,
  		if (num_socks > 0)
  			break;
  	}
@@ -49,12 +49,12 @@ index bae84e5f9..48ec0ab83 100644
  		return -1;
  	}
 diff --git a/channels.h b/channels.h
-index f69096498..bc3b52aa2 100644
+index 6b84e2f2d..39f9b645c 100644
 --- a/channels.h
 +++ b/channels.h
-@@ -391,7 +391,7 @@ int	 permitopen_port(const char *);
+@@ -385,7 +385,7 @@ int	 permitopen_port(const char *);
  
- void	 channel_set_x11_refuse_time(struct ssh *, time_t);
+ void	 channel_set_x11_refuse_time(struct ssh *, double);
  int	 x11_connect_display(struct ssh *);
 -int	 x11_create_display_inet(struct ssh *, int, int, int, u_int *, int **);
 +int	 x11_create_display_inet(struct ssh *, int, int, int, int, u_int *, int **);
@@ -62,10 +62,10 @@ index f69096498..bc3b52aa2 100644
  	    const char *, const char *, const char *, int);
  int      x11_channel_used_recently(struct ssh *ssh);
 diff --git a/servconf.c b/servconf.c
-index d9cccc17c..8746a2417 100644
+index 0d55461e6..dc9624fb5 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -1533,6 +1533,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1582,6 +1582,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  			*intptr = value;
  		break;
  
@@ -76,7 +76,7 @@ index d9cccc17c..8746a2417 100644
  	case sX11UseLocalhost:
  		intptr = &options->x11_use_localhost;
  		goto parse_flag;
-@@ -4249,6 +4253,7 @@ dump_config(ServerOptions *o)
+@@ -4379,6 +4383,7 @@ dump_config(ServerOptions *o)
  #endif
  	dump_cfg_int(sLoginGraceTime, o->login_grace_time);
  	dump_cfg_int(sX11DisplayOffset, o->x11_display_offset);
@@ -85,7 +85,7 @@ index d9cccc17c..8746a2417 100644
  	dump_cfg_int(sMaxSessions, o->max_sessions);
  	dump_cfg_int(sClientAliveInterval, o->client_alive_interval);
 diff --git a/servconf.h b/servconf.h
-index 81e699655..4e5f7edc6 100644
+index 31425c4b2..ccf6134f3 100644
 --- a/servconf.h
 +++ b/servconf.h
 @@ -40,6 +40,7 @@ struct sshbuf;
@@ -96,7 +96,7 @@ index 81e699655..4e5f7edc6 100644
  
  /* Magic name for internal sftp-server */
  #define INTERNAL_SFTP_NAME	"internal-sftp"
-@@ -172,6 +173,7 @@ SSHCONF_INTFLAG(ignore_user_known_hosts, IgnoreUserKnownHosts, SSHCFG_GLOBAL, 0,
+@@ -178,6 +179,7 @@ SSHCONF_INTFLAG(ignore_user_known_hosts, IgnoreUserKnownHosts, SSHCFG_GLOBAL, 0,
  SSHCONF_INTFLAG(print_motd, PrintMotd, SSHCFG_GLOBAL, 1, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(x11_forwarding, X11Forwarding, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH) \
  SSHCONF_INT(x11_display_offset, X11DisplayOffset, SSHCFG_ALL, NULL, SSHD_DEFAULT_X11_DISPLAY_OFFSET, SSHCFG_COPY_MATCH) \
@@ -105,10 +105,10 @@ index 81e699655..4e5f7edc6 100644
  SSHCONF_STRING(xauth_location, XAuthLocation, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(permit_tty, PermitTTY, SSHCFG_ALL, 1, SSHCFG_COPY_MATCH) \
 diff --git a/session.c b/session.c
-index bd8dc808c..e2cf13bdc 100644
+index da116cada..0007f2a57 100644
 --- a/session.c
 +++ b/session.c
-@@ -2693,8 +2693,9 @@ session_setup_x11fwd(struct ssh *ssh, Session *s)
+@@ -2698,8 +2698,9 @@ session_setup_x11fwd(struct ssh *ssh, Session *s)
  		return 0;
  	}
  	if (x11_create_display_inet(ssh, options.x11_display_offset,
@@ -121,18 +121,18 @@ index bd8dc808c..e2cf13bdc 100644
  		return 0;
  	}
 diff --git a/sshd_config.5 b/sshd_config.5
-index 2a8f3abea..bf9efc897 100644
+index 3ae479eda..e2c0ac7e5 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -1430,6 +1430,7 @@ Available keywords are
- .Cm TrustedUserCAKeys ,
+@@ -1457,6 +1457,7 @@ Available keywords are
  .Cm UnusedConnectionTimeout ,
  .Cm X11DisplayOffset ,
+ .Cm X11Forwarding ,
 +.Cm X11MaxDisplays ,
- .Cm X11Forwarding
  and
  .Cm X11UseLocalhost .
-@@ -2147,6 +2148,12 @@ Specifies the first display number available for
+ .It Cm MaxAuthTries
+@@ -2207,6 +2208,12 @@ Specifies the first display number available for
  X11 forwarding.
  This prevents sshd from interfering with real X11 servers.
  The default is 10.
@@ -146,5 +146,5 @@ index 2a8f3abea..bf9efc897 100644
  Specifies whether X11 forwarding is permitted.
  The argument must be
 -- 
-2.55.0
+2.56.0
 

diff --git a/0049-Fix-ssh-pkcs11-client-helper-termination.patch b/0049-Fix-ssh-pkcs11-client-helper-termination.patch
index ba1d2d7..817a550 100644
--- a/0049-Fix-ssh-pkcs11-client-helper-termination.patch
+++ b/0049-Fix-ssh-pkcs11-client-helper-termination.patch
@@ -1,4 +1,4 @@
-From 3bb305e252bed53087559ccedfe631a09b870a9c Mon Sep 17 00:00:00 2001
+From 39970245627d15f7f1b1b9db595a74df301aac0a Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 13 Apr 2026 14:59:26 +0200
 Subject: [PATCH 49/53] Fix ssh-pkcs11-client helper termination
@@ -44,5 +44,5 @@ index 6d74d7280..30a4cf5dc 100644
  	}
  	sshbuf_free(msg);
 -- 
-2.55.0
+2.56.0
 

diff --git a/0050-openssh-10.2p1-pam-auth.patch b/0050-openssh-10.2p1-pam-auth.patch
index 85eb0e6..13b1c99 100644
--- a/0050-openssh-10.2p1-pam-auth.patch
+++ b/0050-openssh-10.2p1-pam-auth.patch
@@ -1,4 +1,4 @@
-From 4a9ecd9744225d274ec05a4aab66acef25498288 Mon Sep 17 00:00:00 2001
+From 83dde2fe2227bce004d200b553c37a58942c4565 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Sun, 12 Apr 2026 12:25:04 +0200
 Subject: [PATCH 50/53] openssh-10.2p1-pam-auth
@@ -39,5 +39,5 @@ index d3dcd037b..aaad16765 100644
  	}
  	return PAM_SUCCESS;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0051-gssapi-s4u.patch b/0051-gssapi-s4u.patch
index 9061918..0dd1991 100644
--- a/0051-gssapi-s4u.patch
+++ b/0051-gssapi-s4u.patch
@@ -1,4 +1,4 @@
-From 13df14017a530856a20dcc0208a67e126178d392 Mon Sep 17 00:00:00 2001
+From 467b4214eecc48e620c0bd60f1e2f1473a5fe7ca Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Sun, 12 Apr 2026 12:25:21 +0200
 Subject: [PATCH 51/53] gssapi-s4u
@@ -10,11 +10,11 @@ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  gss-serv-krb5.c | 225 ++++++++++++++++++++++++++++
  gss-serv.c      | 388 ++++++++++++++++++++++++++++++++++++++++++++++--
  servconf.c      |  46 ++++++
- servconf.h      |   8 +-
+ servconf.h      |   7 +-
  ssh-gss.h       |  13 ++
  sshd-session.c  |  98 ++++++++++++
  sshd_config.5   |  70 +++++++++
- 9 files changed, 851 insertions(+), 20 deletions(-)
+ 9 files changed, 850 insertions(+), 20 deletions(-)
 
 diff --git a/auth-krb5.c b/auth-krb5.c
 index 2e3c1c80f..9cd3618b2 100644
@@ -41,10 +41,10 @@ index 2e3c1c80f..9cd3618b2 100644
  		ret = krb5_cc_new_unique(ctx, type, NULL, ccache);
  		free(type);
 diff --git a/configure.ac b/configure.ac
-index d6274328b..b2c959ff3 100644
+index e850041fb..4d65e4d7e 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -5075,11 +5075,17 @@ AC_ARG_WITH([kerberos5],
+@@ -5084,11 +5084,17 @@ AC_ARG_WITH([kerberos5],
  # include <gssapi_generic.h>
  #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
  # include <gssapi/gssapi_generic.h>
@@ -301,19 +301,19 @@ index fc7cabc09..06d450d4d 100644
  	"toWM5Slw5Ew8Mqkay+al2g==",
  	"Kerberos",
 diff --git a/gss-serv.c b/gss-serv.c
-index 237a3c40a..d7206499d 100644
+index 66d92e4fe..970386127 100644
 --- a/gss-serv.c
 +++ b/gss-serv.c
 @@ -55,7 +55,7 @@ extern ServerOptions options;
  
  static ssh_gssapi_client gssapi_client =
-     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, GSS_C_NO_CREDENTIAL,
--    GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, NULL};
-+    GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, NULL, 0};
+     { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
+-    GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, 0, NULL};
++    GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL, NULL, NULL}, 0, 0, 0, NULL, 0};
  
  ssh_gssapi_mech gssapi_null_mech =
      { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL, NULL};
-@@ -492,26 +492,382 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
+@@ -493,26 +493,382 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
  	return (ctx->major);
  }
  
@@ -712,10 +712,10 @@ index 237a3c40a..d7206499d 100644
  /* As user */
  int
 diff --git a/servconf.c b/servconf.c
-index 8746a2417..667468590 100644
+index dc9624fb5..fda06529d 100644
 --- a/servconf.c
 +++ b/servconf.c
-@@ -1498,6 +1498,43 @@ process_server_config_line_depth(ServerOptions *options, char *line,
+@@ -1547,6 +1547,43 @@ process_server_config_line_depth(ServerOptions *options, char *line,
  		if (options->gss_indicators == NULL)
  			options->gss_indicators = xstrdup(arg);
  		break;
@@ -759,7 +759,7 @@ index 8746a2417..667468590 100644
  #endif /* GSSAPI */
  
  	case sPasswordAuthentication:
-@@ -4290,6 +4327,15 @@ dump_config(ServerOptions *o)
+@@ -4420,6 +4457,15 @@ dump_config(ServerOptions *o)
  	dump_cfg_fmtint(sGSSAPIStoreCredentialsOnRekey, o->gss_store_rekey);
  	dump_cfg_string(sGSSAPIKexAlgorithms, o->gss_kex_algorithms);
  	dump_cfg_string(sGSSAPIIndicators, o->gss_indicators);
@@ -776,36 +776,42 @@ index 8746a2417..667468590 100644
  	dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
  	dump_cfg_fmtint(sKbdInteractiveAuthentication,
 diff --git a/servconf.h b/servconf.h
-index 4e5f7edc6..9ee4a089d 100644
+index ccf6134f3..52a0d1b42 100644
 --- a/servconf.h
 +++ b/servconf.h
-@@ -329,7 +329,9 @@ SSHCONF_INTFLAG(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE
+@@ -239,6 +239,7 @@ SSHCONF_INTFLAG(expose_userauth_info, ExposeAuthInfo, SSHCFG_ALL, 0, SSHCFG_COPY
+ SSHCONF_STRING(sk_provider, SecurityKeyProvider, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
+ SSHCONF_INT(required_rsa_size, RequiredRSASize, SSHCFG_ALL, NULL, SSH_RSA_MINIMUM_MODULUS_SIZE, SSHCFG_COPY_MATCH) \
+ SSHCONF_STRARRAY(channel_timeouts, num_channel_timeouts, ChannelTimeout, SSHCFG_ALL, SSHCFG_COPY_MATCH) \
++SSHCONF_STRARRAY(gss_proxy_services, num_gss_proxy_services, GSSAPIProxyS4U2Services, SSHCFG_ALL, SSHCFG_COPY_MATCH) \
+ SSHCONF_INT(unused_connection_timeout, UnusedConnectionTimeout, SSHCFG_ALL, NULL, 0, SSHCFG_COPY_MATCH) \
+ SSHCONF_STRING(sshd_session_path, SshdSessionPath, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
+ SSHCONF_STRING(sshd_auth_path, SshdAuthPath, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
+@@ -336,7 +337,8 @@ SSHCONF_INTFLAG(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE
  SSHCONF_INTFLAG(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL, 0, SSHCFG_COPY_NONE) \
  SSHCONF_STRING(gss_kex_algorithms, GSSAPIKexAlgorithms, SSHCFG_GLOBAL, SSHCFG_COPY_NONE) \
  SSHCONF_INTFLAG(enable_k5users, GSSAPIEnablek5users, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH) \
 -SSHCONF_STRING(gss_indicators, GSSAPIIndicators, SSHCFG_ALL, SSHCFG_COPY_MATCH)
 +SSHCONF_STRING(gss_indicators, GSSAPIIndicators, SSHCFG_ALL, SSHCFG_COPY_MATCH) \
-+SSHCONF_INTFLAG(gss_allow_s4u2self, GSSAPIAllowS4U2Self, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH) \
-+SSHCONF_STRARRAY(gss_proxy_services, num_gss_proxy_services, GSSAPIProxyS4U2Services, SSHCFG_ALL, SSHCFG_COPY_MATCH)
++SSHCONF_INTFLAG(gss_allow_s4u2self, GSSAPIAllowS4U2Self, SSHCFG_ALL, 0, SSHCFG_COPY_MATCH)
  #else /* GSSAPI */
  #define SSHD_CONFIG_ENTRIES_GSS \
  SSHCONF_UNSUPPORTED_INT(gss_authentication, GSSAPIAuthentication, SSHCFG_ALL) \
-@@ -340,7 +342,9 @@ SSHCONF_UNSUPPORTED_INT(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL) \
+@@ -347,7 +349,8 @@ SSHCONF_UNSUPPORTED_INT(gss_keyex, GSSAPIKeyExchange, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(gss_store_rekey, GSSAPIStoreCredentialsOnRekey, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_STRING(gss_kex_algorithms, GSSAPIKexAlgorithms, SSHCFG_GLOBAL) \
  SSHCONF_UNSUPPORTED_INT(enable_k5users, GSSAPIEnablek5users, SSHCFG_ALL) \
 -SSHCONF_UNSUPPORTED_STRING(gss_indicators, GSSAPIIndicators, SSHCFG_ALL)
 +SSHCONF_UNSUPPORTED_STRING(gss_indicators, GSSAPIIndicators, SSHCFG_ALL) \
-+SSHCONF_UNSUPPORTED_INT(gss_allow_s4u2self, GSSAPIAllowS4U2Self, SSHCFG_ALL) \
-+SSHCONF_UNSUPPORTED_STRING(gss_proxy_services, GSSAPIProxyS4U2Services, SSHCFG_ALL)
++SSHCONF_UNSUPPORTED_INT(gss_allow_s4u2self, GSSAPIAllowS4U2Self, SSHCFG_ALL)
  #endif /* GSSAPI */
  
  #define SSHD_CONFIG_ENTRIES \
 diff --git a/ssh-gss.h b/ssh-gss.h
-index 1506719a9..a0d51c9be 100644
+index e67700417..8ae50fd77 100644
 --- a/ssh-gss.h
 +++ b/ssh-gss.h
-@@ -119,6 +119,7 @@ typedef struct {
+@@ -120,6 +120,7 @@ typedef struct {
  	int used;
  	int updated;
  	char **indicators; /* auth indicators */
@@ -813,7 +819,7 @@ index 1506719a9..a0d51c9be 100644
  } ssh_gssapi_client;
  
  typedef struct ssh_gssapi_mech_struct {
-@@ -199,6 +200,18 @@ OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t);
+@@ -200,6 +201,18 @@ OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t);
  void ssh_gssapi_do_child(char ***, u_int *);
  void ssh_gssapi_cleanup_creds(void);
  int ssh_gssapi_storecreds(void);
@@ -830,13 +836,13 @@ index 1506719a9..a0d51c9be 100644
 +#define SSH_GSSAPI_CCFILTER_PROXY  (1u << 2) /* S4U2Proxy service tickets */
 +void ssh_gssapi_krb5_filter_ccache(u_int, char **, u_int);
  const char *ssh_gssapi_displayname(void);
+ void ssh_gssapi_cleanup_global_client();
  
- char *ssh_gssapi_server_mechanisms(void);
 diff --git a/sshd-session.c b/sshd-session.c
-index adf5b1b49..7d0e25ca1 100644
+index d7168f80a..2f807b4ae 100644
 --- a/sshd-session.c
 +++ b/sshd-session.c
-@@ -1396,6 +1396,104 @@ main(int ac, char **av)
+@@ -1383,6 +1383,104 @@ main(int ac, char **av)
  		authctxt->krb5_set_env = ssh_gssapi_storecreds();
  		restore_uid();
  	}
@@ -942,10 +948,10 @@ index adf5b1b49..7d0e25ca1 100644
  #ifdef WITH_SELINUX
  	sshd_selinux_setup_exec_context(authctxt->pw->pw_name,
 diff --git a/sshd_config.5 b/sshd_config.5
-index bf9efc897..ca8a8131e 100644
+index e2c0ac7e5..5f77ca3d0 100644
 --- a/sshd_config.5
 +++ b/sshd_config.5
-@@ -857,6 +857,76 @@ FIDO2-based pre-authentication in FreeIPA, using FIDO2 USB and NFC tokens
+@@ -883,6 +883,76 @@ FIDO2-based pre-authentication in FreeIPA, using FIDO2 USB and NFC tokens
  The default
  .Dq none
  is to not use GSSAPI authentication indicators for access decisions.
@@ -1023,5 +1029,5 @@ index bf9efc897..ca8a8131e 100644
  The default is handled system-wide by
  .Xr crypto-policies 7 .
 -- 
-2.55.0
+2.56.0
 

diff --git a/0052-openssh-10.2p1-pkcs11-uri.patch b/0052-openssh-10.2p1-pkcs11-uri.patch
index e2926f6..946b353 100644
--- a/0052-openssh-10.2p1-pkcs11-uri.patch
+++ b/0052-openssh-10.2p1-pkcs11-uri.patch
@@ -1,4 +1,4 @@
-From dc4d137cc79b3ec45ed7624c437e86409808438e Mon Sep 17 00:00:00 2001
+From a37213df8ee9fd4a35b438ce568a742e2b837191 Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Mon, 15 Dec 2025 14:24:07 +0100
 Subject: [PATCH 52/53] openssh-10.2p1-pkcs11-uri
@@ -8,10 +8,10 @@ Subject: [PATCH 52/53] openssh-10.2p1-pkcs11-uri
  Makefile.in                      |  26 +-
  configure.ac                     |  37 ++
  regress/Makefile                 |   5 +-
- regress/pkcs11-uri.sh            | 410 ++++++++++++++++
+ regress/pkcs11-uri.sh            | 411 ++++++++++++++++
  regress/unittests/Makefile       |   2 +-
  regress/unittests/pkcs11/tests.c | 353 ++++++++++++++
- ssh-add.c                        |  48 +-
+ ssh-add.c                        |  46 +-
  ssh-agent.c                      | 117 ++++-
  ssh-keygen.c                     |   7 +-
  ssh-pkcs11-client.c              |  19 +
@@ -22,14 +22,14 @@ Subject: [PATCH 52/53] openssh-10.2p1-pkcs11-uri
  ssh.c                            | 104 ++++-
  ssh_config.5                     |  15 +
  sshkey.c                         |   4 +
- 18 files changed, 2134 insertions(+), 273 deletions(-)
+ 18 files changed, 2134 insertions(+), 272 deletions(-)
  create mode 100644 regress/pkcs11-uri.sh
  create mode 100644 regress/unittests/pkcs11/tests.c
  create mode 100644 ssh-pkcs11-uri.c
  create mode 100644 ssh-pkcs11-uri.h
 
 diff --git a/.depend b/.depend
-index 45ad2bf4e..b430c7e77 100644
+index e6722f6e5..1f10f7a33 100644
 --- a/.depend
 +++ b/.depend
 @@ -145,6 +145,7 @@ ssh-mldsa-eddsa.o: includes.h config.h defines.h platform.h openbsd-compat/openb
@@ -41,7 +41,7 @@ index 45ad2bf4e..b430c7e77 100644
  ssh-sk-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/bsd-sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sshbuf.h sshkey.h msg.h pathnames.h ssh-sk.h misc.h
  ssh-sk-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/bsd-sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h sshkey.h authfd.h misc.h sshbuf.h msg.h uidswap.h ssh-sk.h ssh-pkcs11.h
 diff --git a/Makefile.in b/Makefile.in
-index f61f89e4d..23d5f908a 100644
+index 5e539a2cc..2e8fe9f5c 100644
 --- a/Makefile.in
 +++ b/Makefile.in
 @@ -113,12 +113,12 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
@@ -127,10 +127,10 @@ index f61f89e4d..23d5f908a 100644
  tests:	file-tests t-exec interop-tests extra-tests unit
  	echo all tests passed
 diff --git a/configure.ac b/configure.ac
-index b2c959ff3..c37b02efb 100644
+index 4d65e4d7e..72ce8a224 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -2305,12 +2305,14 @@ AC_LINK_IFELSE(
+@@ -2312,12 +2312,14 @@ AC_LINK_IFELSE(
  	[AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).])
  ])
  
@@ -145,7 +145,7 @@ index b2c959ff3..c37b02efb 100644
  		fi
  	]
  )
-@@ -2340,6 +2342,40 @@ AC_SEARCH_LIBS([dlopen], [dl])
+@@ -2347,6 +2349,40 @@ AC_SEARCH_LIBS([dlopen], [dl])
  AC_CHECK_FUNCS([dlopen])
  AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>])
  
@@ -186,7 +186,7 @@ index b2c959ff3..c37b02efb 100644
  # IRIX has a const char return value for gai_strerror()
  AC_CHECK_FUNCS([gai_strerror], [
  	AC_DEFINE([HAVE_GAI_STRERROR])
-@@ -5921,6 +5957,7 @@ echo "                  BSD Auth support: $BSD_AUTH_MSG"
+@@ -5920,6 +5956,7 @@ echo "                  BSD Auth support: $BSD_AUTH_MSG"
  echo "              Random number source: $RAND_MSG"
  echo "             Privsep sandbox style: $SANDBOX_STYLE"
  echo "                   PKCS#11 support: $enable_pkcs11"
@@ -226,7 +226,7 @@ index fa19ada28..492112e80 100644
  			-d ${.CURDIR}/unittests/sshkey/testdata $${ARGS}; \
 diff --git a/regress/pkcs11-uri.sh b/regress/pkcs11-uri.sh
 new file mode 100644
-index 000000000..72d69bda0
+index 000000000..75a6f290a
 --- /dev/null
 +++ b/regress/pkcs11-uri.sh
 @@ -0,0 +1,411 @@
@@ -1013,7 +1013,7 @@ index 000000000..89ba45c4e
 +}
 +
 diff --git a/ssh-add.c b/ssh-add.c
-index 9231c5277..1b34baffa 100644
+index 515272a35..3daeea44e 100644
 --- a/ssh-add.c
 +++ b/ssh-add.c
 @@ -70,6 +70,7 @@
@@ -1030,7 +1030,7 @@ index 9231c5277..1b34baffa 100644
  
 +#ifdef ENABLE_PKCS11
 +static int
-+update_card(int agent_fd, int add, const char *id, int qflag,
++update_card(int agent_fd, int add, const char *id, int qflag, int no_pin,
 +    int key_only, int cert_only,
 +    struct dest_constraint **dest_constraints, size_t ndest_constraints,
 +    struct sshkey **certs, size_t ncerts, char *pin);
@@ -1055,7 +1055,7 @@ index 9231c5277..1b34baffa 100644
 +	}
 +	pkcs11_uri_cleanup(uri);
 +
-+	return update_card(agent_fd, adding, pkcs11_uri, qflag, 1, 0,
++	return update_card(agent_fd, adding, pkcs11_uri, qflag, 0, 1, 0,
 +	           dest_constraints, ndest_constraints, NULL, 0, pin);
 +}
 +#endif
@@ -1063,8 +1063,8 @@ index 9231c5277..1b34baffa 100644
  static int
  add_file(int agent_fd, const char *filename, int key_only, int cert_only,
      int qflag, int Nflag, const char *skprovider,
-@@ -461,15 +494,14 @@ static int
- update_card(int agent_fd, int add, const char *id, int qflag,
+@@ -461,9 +494,8 @@ static int
+ update_card(int agent_fd, int add, const char *id, int qflag, int no_pin,
      int key_only, int cert_only,
      struct dest_constraint **dest_constraints, size_t ndest_constraints,
 -    struct sshkey **certs, size_t ncerts)
@@ -1074,14 +1074,7 @@ index 9231c5277..1b34baffa 100644
  	int r, ret = -1;
  
  	if (key_only)
- 		ncerts = 0;
- 
--	if (add) {
-+	if (add && pin == NULL) {
- 		if ((pin = read_passphrase("Enter passphrase for PKCS#11: ",
- 		    RP_ALLOW_STDIN)) == NULL)
- 			return -1;
-@@ -651,6 +683,14 @@ do_file(int agent_fd, int deleting, int key_only, int cert_only,
+@@ -656,6 +688,14 @@ do_file(int agent_fd, int deleting, int key_only, int cert_only,
      char *file, int qflag, int Nflag, const char *skprovider,
      struct dest_constraint **dest_constraints, size_t ndest_constraints)
  {
@@ -1096,9 +1089,9 @@ index 9231c5277..1b34baffa 100644
  	if (deleting) {
  		if (delete_file(agent_fd, file, key_only,
  		    cert_only, qflag) == -1)
-@@ -1003,7 +1043,7 @@ main(int argc, char **argv)
+@@ -1011,7 +1051,7 @@ main(int argc, char **argv)
  		if (update_card(agent_fd, !deleting, pkcs11provider,
- 		    qflag, key_only, cert_only,
+ 		    qflag, no_pin, key_only, cert_only,
  		    dest_constraints, ndest_constraints,
 -		    certs, ncerts) == -1)
 +		    certs, ncerts, NULL) == -1)
@@ -1106,10 +1099,10 @@ index 9231c5277..1b34baffa 100644
  		for (n = 0; n < ncerts; n++)
  			sshkey_free(certs[n]);
 diff --git a/ssh-agent.c b/ssh-agent.c
-index 4c8e1a4da..28f5c95f9 100644
+index f08f7c3b1..525d02cf1 100644
 --- a/ssh-agent.c
 +++ b/ssh-agent.c
-@@ -1553,10 +1553,75 @@ add_p11_identity(struct sshkey *key, char *comment, const char *provider,
+@@ -1555,10 +1555,75 @@ add_p11_identity(struct sshkey *key, char *comment, const char *provider,
  	idtab->nentries++;
  }
  
@@ -1186,7 +1179,7 @@ index 4c8e1a4da..28f5c95f9 100644
  	char **comments = NULL;
  	int r, i, count = 0, success = 0, confirm = 0;
  	u_int seconds = 0;
-@@ -1585,25 +1650,18 @@ process_add_smartcard_key(SocketEntry *e)
+@@ -1587,25 +1652,18 @@ process_add_smartcard_key(SocketEntry *e)
  		    "providers is disabled", provider);
  		goto send;
  	}
@@ -1217,7 +1210,7 @@ index 4c8e1a4da..28f5c95f9 100644
  		}
  		for (j = 0; j < ncerts; j++) {
  			if (!sshkey_is_cert(certs[j]))
-@@ -1613,13 +1671,13 @@ process_add_smartcard_key(SocketEntry *e)
+@@ -1615,13 +1673,13 @@ process_add_smartcard_key(SocketEntry *e)
  			if (pkcs11_make_cert(keys[i], certs[j], &k) != 0)
  				continue;
  			add_p11_identity(k, xstrdup(comments[i]),
@@ -1233,7 +1226,7 @@ index 4c8e1a4da..28f5c95f9 100644
  			    dest_constraints, ndest_constraints);
  			keys[i] = NULL;		/* transferred */
  			comments[i] = NULL;	/* transferred */
-@@ -1632,6 +1690,7 @@ process_add_smartcard_key(SocketEntry *e)
+@@ -1634,6 +1692,7 @@ process_add_smartcard_key(SocketEntry *e)
  send:
  	free(pin);
  	free(provider);
@@ -1241,7 +1234,7 @@ index 4c8e1a4da..28f5c95f9 100644
  	free(keys);
  	free(comments);
  	free_dest_constraints(dest_constraints, ndest_constraints);
-@@ -1644,8 +1703,8 @@ send:
+@@ -1646,8 +1705,8 @@ send:
  static void
  process_remove_smartcard_key(SocketEntry *e)
  {
@@ -1252,7 +1245,7 @@ index 4c8e1a4da..28f5c95f9 100644
  	Identity *id, *nxt;
  
  	debug2_f("entering");
-@@ -1656,30 +1715,38 @@ process_remove_smartcard_key(SocketEntry *e)
+@@ -1658,30 +1717,38 @@ process_remove_smartcard_key(SocketEntry *e)
  	}
  	free(pin);
  
@@ -1300,10 +1293,10 @@ index 4c8e1a4da..28f5c95f9 100644
  }
  #endif /* ENABLE_PKCS11 */
 diff --git a/ssh-keygen.c b/ssh-keygen.c
-index ed1932ff0..342b0c57d 100644
+index f27b08915..b20e246d3 100644
 --- a/ssh-keygen.c
 +++ b/ssh-keygen.c
-@@ -820,8 +820,11 @@ do_download(struct passwd *pw)
+@@ -859,8 +859,11 @@ do_download(struct passwd *pw)
  			free(fp);
  		} else {
  			(void) sshkey_write(keys[i], stdout); /* XXX check */
@@ -3216,7 +3209,7 @@ index 1d0277a6d..13459644c 100644
  	    const u_char *, size_t, const char *, const char *,
  	    const char *, u_int);
 diff --git a/ssh.c b/ssh.c
-index 0182cc567..c8f3545af 100644
+index 68c16c79c..adc6d2f81 100644
 --- a/ssh.c
 +++ b/ssh.c
 @@ -848,6 +848,14 @@ main(int ac, char **av)
@@ -3234,7 +3227,7 @@ index 0182cc567..c8f3545af 100644
  			p = tilde_expand_filename(optarg, getuid());
  			if (stat(p, &st) == -1)
  				fprintf(stderr, "Warning: Identity file %s "
-@@ -1832,6 +1840,7 @@ main(int ac, char **av)
+@@ -1836,6 +1844,7 @@ main(int ac, char **av)
  
  #ifdef ENABLE_PKCS11
  	(void)pkcs11_del_provider(options.pkcs11_provider);
@@ -3242,7 +3235,7 @@ index 0182cc567..c8f3545af 100644
  #endif
  
   skip_connect:
-@@ -2356,6 +2365,45 @@ ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo)
+@@ -2360,6 +2369,45 @@ ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo)
  	    options.escape_char : SSH_ESCAPECHAR_NONE, id);
  }
  
@@ -3288,7 +3281,7 @@ index 0182cc567..c8f3545af 100644
  /* Loads all IdentityFile and CertificateFile keys */
  static void
  load_public_identity_files(const struct ssh_conn_info *cinfo)
-@@ -2370,11 +2418,6 @@ load_public_identity_files(const struct ssh_conn_info *cinfo)
+@@ -2374,11 +2422,6 @@ load_public_identity_files(const struct ssh_conn_info *cinfo)
  	char *certificate_files[SSH_MAX_CERTIFICATE_FILES];
  	struct sshkey *certificates[SSH_MAX_CERTIFICATE_FILES];
  	int certificate_file_userprovided[SSH_MAX_CERTIFICATE_FILES];
@@ -3300,7 +3293,7 @@ index 0182cc567..c8f3545af 100644
  
  	n_ids = n_certs = 0;
  	memset(identity_files, 0, sizeof(identity_files));
-@@ -2387,33 +2430,46 @@ load_public_identity_files(const struct ssh_conn_info *cinfo)
+@@ -2391,33 +2434,46 @@ load_public_identity_files(const struct ssh_conn_info *cinfo)
  	    sizeof(certificate_file_userprovided));
  
  #ifdef ENABLE_PKCS11
@@ -3367,7 +3360,7 @@ index 0182cc567..c8f3545af 100644
  		free(cp);
  		check_load(sshkey_load_public(filename, &public, NULL),
 diff --git a/ssh_config.5 b/ssh_config.5
-index f2ff8585c..f16eb61ea 100644
+index a4fbecf35..47d00970b 100644
 --- a/ssh_config.5
 +++ b/ssh_config.5
 @@ -1304,6 +1304,21 @@ may also be used in conjunction with
@@ -3393,10 +3386,10 @@ index f2ff8585c..f16eb61ea 100644
  Specifies a pattern-list of unknown options to be ignored if they are
  encountered in configuration parsing.
 diff --git a/sshkey.c b/sshkey.c
-index 2380c8081..084ff3b55 100644
+index 533b8ffa9..8560ba46a 100644
 --- a/sshkey.c
 +++ b/sshkey.c
-@@ -852,8 +852,10 @@ sshkey_free_contents(struct sshkey *k)
+@@ -854,8 +854,10 @@ sshkey_free_contents(struct sshkey *k)
  
  	if (k == NULL)
  		return;
@@ -3407,7 +3400,7 @@ index 2380c8081..084ff3b55 100644
  	if ((impl = sshkey_impl_from_type(k->type)) != NULL &&
  	    impl->funcs->cleanup != NULL)
  		impl->funcs->cleanup(k);
-@@ -2300,9 +2302,11 @@ sshkey_sign(struct sshkey *key,
+@@ -2334,9 +2336,11 @@ sshkey_sign(struct sshkey *key,
  	if (sshkey_is_sk(key)) {
  		r = sshsk_sign(sk_provider, key, sigp, lenp, data,
  		    datalen, compat, sk_pin);
@@ -3420,5 +3413,5 @@ index 2380c8081..084ff3b55 100644
  		if (impl->funcs->sign == NULL)
  			r = SSH_ERR_SIGN_ALG_UNSUPPORTED;
 -- 
-2.55.0
+2.56.0
 

diff --git a/0053-gssapi-tests.patch b/0053-gssapi-tests.patch
index 26fa784..5d48c26 100644
--- a/0053-gssapi-tests.patch
+++ b/0053-gssapi-tests.patch
@@ -1,4 +1,4 @@
-From 90f47f37aa1b16d2039f3ed1a37ab418be09a2e1 Mon Sep 17 00:00:00 2001
+From 3ae6218eb5b77a5d66158d570df485f9a4197bbf Mon Sep 17 00:00:00 2001
 From: Dmitry Belyavskiy <beldmit@gmail.com>
 Date: Thu, 15 May 2025 13:43:28 +0200
 Subject: [PATCH 53/53] gssapi-tests
@@ -226,5 +226,5 @@ index 000000000..63b2e178b
 +unset KRB5RCACHETYPE
 +rm -rf "$gssdir"
 -- 
-2.55.0
+2.56.0
 

diff --git a/openssh.spec b/openssh.spec
index 4552075..2cba129 100644
--- a/openssh.spec
+++ b/openssh.spec
@@ -34,12 +34,12 @@
 # rpm -ba|--rebuild --define 'no_gtk3 1'
 %{?no_gtk3:%global gtk3 0}
 
-%global openssh_ver 10.5p1
+%global openssh_ver 10.6p1
 
 Summary: An open source implementation of SSH protocol version 2
 Name: openssh
 Version: %{openssh_ver}
-Release: 2%{?dist}
+Release: 1%{?dist}
 URL: http://www.openssh.com/portable.html
 Source0: https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
 Source1: https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc
@@ -522,6 +522,9 @@ test -f %{sysconfig_anaconda} && \
 %attr(0755,root,root) %{_libdir}/sshtest/sk-dummy.so
 
 %changelog
+* Wed Oct 21 2026 Dmitry Belyavskiy <dbelyavs@redhat.com> - 10.6p1-1
+- Rebasing OpenSSH to 10.6p1
+
 * Thu Sep 24 2026 Dmitry Belyavskiy <dbelyavs@redhat.com> - 10.5p1-2
 - Make pkcs11-uri test compatible with GNOME
 

diff --git a/sources b/sources
index dc67a06..66231a7 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
-SHA512 (openssh-10.5p1.tar.gz) = 5336c1945527b29ed59cc500fa8bfbd918f5ba97e85512daad9ab7241418929bf7152d300e5f3c5f9a8c8d699dfde5a64c5faa4fc33b2758ab52dd04040d6284
-SHA512 (openssh-10.5p1.tar.gz.asc) = b31e61d98420598e40c9f7515e833c140415dd1f59391a558e3f48c878d1fa1defc8ec316a17a9737302cded54a216a95425a785e661adc86d70dd2c95014fe7
+SHA512 (openssh-10.6p1.tar.gz) = 243e07c8c68c649552ee019e6aac4393634de6e403cb793b3cd756d5c46e84cc8b2b560e6c0b36e8fb48979b109f888317411a9d640583109117ea621f27700a
+SHA512 (openssh-10.6p1.tar.gz.asc) = 007bb7ff1f0497e066c496f39cb6584cdec46db2cdb7d54efbaa71e84f19b43bcfd82d345bf4eeb92c363c8dcbb3500257599e6300fcbff4b69d688220451571
 SHA512 (gpgkey-736060BA.gpg) = df44f3fdbcd1d596705348c7f5aed3f738c5f626a55955e0642f7c6c082995cf36a1b1891bb41b8715cb2aff34fef1c877e0eff0d3507dd00a055ba695757a21

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-21 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21 16:28 [rpms/openssh] f45: Rebasing OpenSSH to 10.6p1 Dmitry Belyavskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox