Skip to content

OpenSSH 10.4p1 uplift - #198

Open
andrewyounkers wants to merge 197 commits into
open-quantum-safe:OQS-v10from
andrewyounkers:feature/openssh_10_4_uplift
Open

OpenSSH 10.4p1 uplift#198
andrewyounkers wants to merge 197 commits into
open-quantum-safe:OQS-v10from
andrewyounkers:feature/openssh_10_4_uplift

Conversation

@andrewyounkers

Copy link
Copy Markdown

This PR merges in upstream commits from the OpenSSH-portable V_10_4_P1 tag by running a git merge V_10_4_P1. The main changes that I noticed during the uplift causing conflicts had to do with the upstream addition of enabling the ssh-mldsa44-ed25519 hybrid signature algorithm.

All merge conflict resolutions are shown in commit: 1dc4dc1. I used the following methodology to resolve all merge conflicts

  • Accept current to preserve OQS specific logic
  • Accept any combinations needed to bring in updated upstream code but keep OQS specific code
  • Accept incoming for all other conflicts to bring in new upstream logic

In the past OQS-SSH has rejected upstream OpenSSH hybrid PQ algorithms due to them already being implemented in the project, but this is a case where the upstream is adding a new algorithm the project doesn't already support. Since there was no conflict in bringing in this new algorithm, I kept the upstream code enabled and as such ssh-mldsa44-ed25519@openssh.com is now available in this project. I added a note to the README to address this in the following commit: 1ef3c3a.

djmdjm and others added 30 commits April 15, 2026 08:14
This was missed after the file was updated, but nobody noticed it
until now.
-> uintXX_t

OpenBSD-Commit-ID: 6d5e80bd6f29a9db18b18beeb1cbe5423b59de44
~I escape

OK dtucker@

OpenBSD-Commit-ID: 695c1a09c4cc8b417a1bd3eb207b0cc7fa831c7a
Fixes interactive vs bulk IPQoS for client->server traffic. ok job@

OpenBSD-Commit-ID: 34f5131face8d6dc4ae6955196e5fcafb3570cfe
OpenSSL 4 removes support for ENGINE, but it provides no-op stubs
for the ENGINE functions in addition to setting OPENSSL_NO_ENGINE.

The presence of the stubs fooled the old configure test, so if someone
tried --with-ssl-engine with OpenSSL 4.0.0 it'd try but fail at build
time.  Explicitly check for OPENSSL_NO_ENGINE. before trying to enable
ENGINE support.  bz#3952.
Recently Cygwin imported changes from Fedora which disable SHA1
signatures by default.  This breaks the unit tests (and a couple of
regression tests), so set rh-allow-sha1-signatures=yes in the OpenSSL
config to re-enable them.
On sparc64 ssh/unittests/kex fails to build with:
 usr.bin/ssh/libcrux_mlkem768_sha3.h:8196: warning: inlining failed
 in call to 'libcrux_ml_kem_polynomial_ZERO_89_ea':
 --param max-inline-insns-single limit reached

OK djm@ (long time ago) reminded by tb@

OpenBSD-Regress-ID: c32094e3436536474039a4aeefabdbf0bd826554
sshd_config instead of supported key types, which is almost but not
completely correct.

OpenBSD-Regress-ID: 43c3b348576900f3e710bff5d6a87f0e803c5b3d
channels does

OK djm@

OpenBSD-Commit-ID: fa035fb19b74571992fa3adca4396a4c572a7a8a
so it can be cleaned up at exit.

Reported by / tested by David Krause, ok markus@

OpenBSD-Commit-ID: b45d740e9a63dec0fad436ed78f6912b39f0cd53
fortify warnings on android. bz3954

OpenBSD-Commit-ID: 82224426b2ee989c68f305caa50aa3d3b4993a84
Add missing SSHD_CONFOPTS="UsePam yes" to the solaris PAM test
step so it actually tests PAM functionality instead of re-running
the default tests with a PAM-enabled binary.
we don't use the in OpenSSH and some compilers throw warnings
compiling them that break -Werror
There's no point rerunning unit tests.
 - Set up and run tests with SUDO.
 - Set random password to use for password & kbdint auth tests.
 - Only run t-exec when re-testing with PAM, don't rerun unit tests.
 - When testing PAM builds, test with and without UsePAM.
djmdjm and others added 22 commits July 3, 2026 12:31
This rewrites most of the privsep description to more accurately capture
recent changes in how sshd managed privilege across its lifecycle,
including describing the roles of the sshd-session and sshd-auth
helper binaries.

Also 100% more ASCII art
Laurence Tratt

OpenBSD-Commit-ID: bcef522cfa587c7cf035660bb347cff36b65bfbd
Rice.

OpenBSD-Commit-ID: bb5021b2b45d9d3f54a012d569872805d107f59c
authentication where the minimum per-attempt delay was not being enforced.

Reported by Orange Cyberdefense Vulnerability Team

OpenBSD-Commit-ID: c40bd35cc2428fcaccad7a141703c28baa6da01e
state that need to persist for the life of the connection, especially the
cached hostkey that was being incorrectly freed early on some paths, possibly
allowing its use after free.

Reported by Zhenpeng (Leo) Lin from depthfirst.com

OpenBSD-Commit-ID: faaa6ad72e7d69d41fa8b197b606265b7d9bc73f
problems

1) Remove an early failure return for GSSAPI authentication attempts
made for invalid accounts that yielded different behaviour for
valid vs invalid accounts.

2) Fix a situation where some GSSAPI requestes were not correctly
subjected to MaxAuthTries.

3) Fix a moderate pre-authentication resource DoS related to #2.

Add missing logging for error cases.

Report and fixes from Manfred Kaiser, milCERT AT

OpenBSD-Commit-ID: ca0acdd64eea435d6f89534538a9eb404a5629d3
OpenBSD-Commit-ID: ce7b0749e5139c70410ee92a13d368d7d34262b5
refactoring servconf.c bz3974 patch from Colin Watson

OpenBSD-Commit-ID: be39ad3dbe36d9ecdb86f3811da5dfbdc9bcb1e6
This is documented to be allowed, and was up until 10.4p1 when a
transcription error in the config handling rework reverted it to
global-only, ie not allowed inside Match.  bz#3987.
Signed-off-by: Andrew Younkers <ayounkers44@gmail.com>
Signed-off-by: Andrew Younkers <ayounkers44@gmail.com>
Signed-off-by: Andrew Younkers <ayounkers44@gmail.com>
Signed-off-by: Andrew Younkers <ayounkers44@gmail.com>
@andrewyounkers andrewyounkers self-assigned this Aug 11, 2026
@andrewyounkers
andrewyounkers marked this pull request as ready for review August 11, 2026 19:37
@baentsch

Copy link
Copy Markdown
Member

In the past OQS-SSH has rejected upstream OpenSSH hybrid PQ algorithms due to them already being implemented in the project,

Thanks for pointing this out @andrewyounkers ! This in my eyes is a statement and stance that surprises me: Can you point to such instances? What's your personal thought around this: Are you of the opinion that OQS has the resources and development principles allowing it to replace (presumably) well-maintained upstream code?

fwiw, in oqs-provider (for openssl) I took the exact opposite stance, namely to remove PQ algs (and of course also their hybrids) that the upstream began to carry on the grounds that the upstream is the professionally maintained crypto lib and OQS doesn't have resources nor development principles warranting it over-ruling such well-maintained upstream code.

On the alg itself,

the upstream addition of enabling the ssh-mldsa44-ed25519 hybrid signature algorithm

allow me to ask the question what this update then removes from the upstream: The complete crypto, i.e., also an ML-DSA from the upstream, or just the hybrid-ization, i.e., ML-DSA still comes from the upstream? If the former, are there no other hybrids (that then would differ in terms of where the PQ logic comes from)?

FWIW, for openssl I began work on a provider that does hybrid-ization independent of the original crypto provider to still allow PQ experimentation -- but not by-default "overrule" the upstream: Might the same approach be worth-while considering here?

All told, I see the principle

Accept current to preserve OQS specific logic

highly skeptical and wouldn't follow it nor approve a PR doing so. Good I have not been asked to do so :-). So just take this statement as a correction of possibly committed prior crimes (should I have set the precedent you mentioned above of rejecting upstream OpenSSH hybrid PQ algorithms: I am willing to stand corrected when I see I made mistakes).

@andrewyounkers

Copy link
Copy Markdown
Author

In the past OQS-SSH has rejected upstream OpenSSH hybrid PQ algorithms due to them already being implemented in the project,

Thanks for pointing this out @andrewyounkers ! This in my eyes is a statement and stance that surprises me: Can you point to such instances? What's your personal thought around this: Are you of the opinion that OQS has the resources and development principles allowing it to replace (presumably) well-maintained upstream code?

The two examples that I was referencing were sntrup761x25519-sha512@openssh.com and mlkem768x25519-sha256. The openssh implementation of these algorithms are disabled in defines.h and OQS-SSH/liboqs logic is used instead to provide these algorithms. This logic was in place before my involvement with OQS-SSH so I had preserved it throughout uplifts.

I am personally of the opinion to prefer the upstream code for the reason you mentioned of it being well-maintained code. I am willing to swap these algorithms to the OpenSSH implementation in this PR for all the reasons you provided above and carry on with the precedent set by the oqs-provider.

fwiw, in oqs-provider (for openssl) I took the exact opposite stance, namely to remove PQ algs (and of course also their hybrids) that the upstream began to carry on the grounds that the upstream is the professionally maintained crypto lib and OQS doesn't have resources nor development principles warranting it over-ruling such well-maintained upstream code.

On the alg itself,

the upstream addition of enabling the ssh-mldsa44-ed25519 hybrid signature algorithm

allow me to ask the question what this update then removes from the upstream: The complete crypto, i.e., also an ML-DSA from the upstream, or just the hybrid-ization, i.e., ML-DSA still comes from the upstream? If the former, are there no other hybrids (that then would differ in terms of where the PQ logic comes from)?

This update doesn't replace the complete crypto implementation of ssh-mldsa44-ed25519 from the upstream. The upstream calls OpenSSH's bundled libcrux ML-DSA implementation where all other signature algorithms call liboqs. If the above algorithms were swapped to enable the OpenSSH code, only the three algorithms mentioned in this comment would differ in terms of where the PQ logic comes from.

FWIW, for openssl I began work on a provider that does hybrid-ization independent of the original crypto provider to still allow PQ experimentation -- but not by-default "overrule" the upstream: Might the same approach be worth-while considering here?

I do think the same approach of the hybrid provider would be worthwhile here especially as more PQ algorithms become supported by OpenSSH. I can make an issue for tracking this feature in the long-term. Moving forward until that is implemented, I think it is best to prefer the upstream algorithm when OpenSSH makes one available.

All told, I see the principle

Accept current to preserve OQS specific logic

highly skeptical and wouldn't follow it nor approve a PR doing so. Good I have not been asked to do so :-). So just take this statement as a correction of possibly committed prior crimes (should I have set the precedent you mentioned above of rejecting upstream OpenSSH hybrid PQ algorithms: I am willing to stand corrected when I see I made mistakes).

Thank you @baentsch for the thoughtful comments, I hope this addressed your questions but will be able to further discuss if there is a follow-up. I will include a reply to the last section in a new comment as my response is a bit long - sorry :-)

@andrewyounkers

Copy link
Copy Markdown
Author

@baentsch In regards to the comments around " Accept current to preserve OQS specific logic", I would like to clarify what I meant by that bullet point and seek guidance for the future.

When resolving merge conflicts my priority is to always bring in the new upstream code first. If there is OQS specific logic that after investigating needs to be kept, I bring in a combination of the changes to get the incoming logic without breaking the OQS specific logic in place. I will note there are not very many of these cases.

Majority of the merge conflicts that I have experienced during the uplifts come from OQS code surrounded by ///// OQS_TEMPLATE_FRAGMENT comments or the OQS specific case statement CASE_KEY_OQS:. Most of what I have seen is that the incoming changes just remove these sections, so accepting "current" for these conflicts just preserves what is needed for OQS algorithms without losing any new upstream logic. If there are upstream changes in the conflicts surrounding the OQS code, the new code gets brought in as a combination. This is what I was referencing in the above bullet point, which I can now see wasn't a very good or clear description on my end.

With this explanation does it alleviate any of your concerns? If this still is troubling is there a better process that I can follow in future uplifts? I apologize for not being more clear in my description, and will include more thorough explanations of the merge conflict resolution process in future uplift PRs.

This commit addresses PR comments in open-quantum-safe#198. The changes here are to remove OQS implementations and generation of sntrup761x25519-sha512@openssh.com and mlkem768x25519-sha256 in favor of the upstream OpenSSH's implementaion of these algorithms.

Signed-off-by: Andrew Younkers <ayounkers44@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.