Skip to content

Add Fedora openssh-10.2p1 FIPS patch for wolfProvider#336

Open
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:wp_openssh_rhel_10_2p1_fips
Open

Add Fedora openssh-10.2p1 FIPS patch for wolfProvider#336
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley:wp_openssh_rhel_10_2p1_fips

Conversation

@ColtonWilley
Copy link
Copy Markdown
Contributor

Summary

Adds openssh-RHEL-10.2p1-FIPS-wolfprov.patch, sibling to #332 (openssh-9.9p1). Targets Fedora 44's patched openssh-10.2p1, which carries the SSHKDF routing patch (openssh-8.0p1-openssl-kdf.patch) and the FIPS adaptation patch (openssh-7.7p1-fips.patch) — the same Red Hat-derived test-fixture hostility to FIPS-restricted crypto we hit on 9.9p1.

The patch:

  • drops t1 (RSA-1024), t4 (MD5), t10 and t12 (Ed25519 keygen) from REGRESS_TARGETS (t6/t8 were removed upstream when DSA was deleted);
  • skips test_sshkey, test_sshsig, test_authopt, test_hostkeys whose testdata trees use Ed25519/DSA/short-RSA keys;
  • pins FIPS-compliant ciphers/MACs in regress/unittests/kex/test_kex.c, drops the Ed25519 host-key path, and strips curve25519/DH-SHA1/MLKEM/sntrup761 from kex_tests so SSHKDF still runs through ECDH-NIST + DH-GEX-SHA256;
  • removes a redundant #include "ssh-pkcs11-uri.h" from ssh-pkcs11.c to work around an unrelated build break in Fedora's 0052-openssh-10.2p1-pkcs11-uri.patch (the URI header lacks include guards and ends up pulled into the same TU twice — once direct, once via ssh-pkcs11.h).

Also refreshes wolfProvider/openssh/README.md, which listed only the two original non-FIPS patches plus a stale reference to a openssh-FIPS-wolfprov.patch that does not exist in this directory. Indexes the three FIPS patches now present (openssh-V_9_6_P1-FIPS-wolfprov, openssh-RHEL-9.9p1-FIPS-wolfprov from #332, and the new openssh-RHEL-10.2p1-FIPS-wolfprov) with one line per patch describing the OpenSSH source it targets.

Validated on a CentOS Stream 10 FIPS-enabled VM (fips=1, update-crypto-policies --set FIPS) against three stacks:

Stack Result
Stock openssl-3.5.5-2.el10 (no patch) red — t1/t4/t10/t12 + test_sshkey (RSA-1024) fail in FIPS
wolfProvider fips-baseline patched OpenSSL 3.5.5 + this patch green
wolfProvider + FIPS wolfSSL (5.9.1-fips-ready) + this patch green

test_kex runs all 90 cases under wolfProvider-as-default-OpenSSL-provider, so SSHKDF routes through wolfSSL's FIPS module via the openssl-kdf RHEL patch.

Test plan

  • rpmbuild --short-circuit -bc of Fedora f44 dist-git openssh-10.2p1 against system OpenSSL 3.5.5 in FIPS mode (with this patch applied — without it the pkcs11 hunk above blocks the build)
  • Baseline regress (no patch) reproduces the expected RHEL+FIPS failure pattern (RSA-1024, MD5, Ed25519, RSA-1024-in-test_sshkey)
  • With patch + fips-baseline OpenSSL: make -k file-tests interop-tests extra-tests unit is green
  • With patch + wolfProvider+FIPS wolfSSL: same target set is green
  • regress/unittests/kex/test_kex exercises SSHKDF via the openssl-kdf RHEL patch under wolfProvider's EVP_KDF SSHKDF implementation
  • README parses cleanly as Markdown; every filename listed exists in the directory after this PR and Add RHEL openssh 9.9p1 FIPS patch for wolfProvider #332 merge

Adds openssh-RHEL-10.2p1-FIPS-wolfprov.patch, sibling to the
openssh-RHEL-9.9p1-FIPS-wolfprov.patch added separately. Targets
Fedora 44's openssh-10.2p1 + 59-patch RHEL set (which carries the
SSHKDF routing patch openssh-8.0p1-openssl-kdf.patch and the FIPS
adaptation patch openssh-7.7p1-fips.patch); the Red Hat-derived
test fixtures still exercise pre-FIPS algorithms (Ed25519, MD5,
RSA-1024, curve25519, SHA1, chacha20, MLKEM, sntrup761) which a
FIPS-restricted OpenSSL or the wolfProvider fips-baseline build
refuses.

Patch contents:

  regress/Makefile
    - REGRESS_TARGETS: drop t1 (RSA-1024), t4 (MD5), t10 and t12
      (Ed25519 keygen). t6 and t8 are not dropped because openssh
      removed the DSA ssh-keygen tests in 10.x.
    - unit: skip test_sshkey, test_sshsig, test_authopt,
      test_hostkeys, whose testdata uses Ed25519/DSA/short-RSA
      keys that FIPS refuses.

  regress/unittests/kex/test_kex.c
    - do_kex_with_key gained cipher/mac/key parameters in the 10.x
      signature; the FIPS-compliant cipher/MAC pins are applied
      unconditionally inside the function body to override callers
      that pass NULL.
    - do_kex: drop the KEY_ED25519 host-key invocation.
    - kex_tests: drop curve25519, DH-SHA1, sntrup761, and MLKEM
      kex invocations.

  ssh-pkcs11.c
    - Drop the duplicate `#include "ssh-pkcs11-uri.h"`. Fedora's
      0052-openssh-10.2p1-pkcs11-uri.patch makes ssh-pkcs11.h
      include the URI header, leaving both pulled into the same
      translation unit; without include guards on the URI header
      the resulting `struct pkcs11_uri` redefinition refuses to
      compile.

Also refreshes wolfProvider/openssh/README.md, which listed only
the two non-FIPS patches plus a stale reference to a
`openssh-FIPS-wolfprov.patch` that does not exist in this directory.
The three FIPS patches now present (openssh-V_9_6_P1-FIPS-wolfprov,
openssh-RHEL-9.9p1-FIPS-wolfprov, and the new
openssh-RHEL-10.2p1-FIPS-wolfprov) are indexed with one line per
patch describing the OpenSSH source it targets.
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.

1 participant