Skip to content

Add DenyRSA and DenyECC SSLOptions (Issue #163) - #232

Open
rue19 wants to merge 1 commit into
OpenPrinting:masterfrom
rue19:pqc-deny-rsa-ecc
Open

rue19 wants to merge 1 commit into
OpenPrinting:masterfrom
rue19:pqc-deny-rsa-ecc

Conversation

@rue19

@rue19 rue19 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

This covers the first item in #163: DenyRSA and DenyECC for SSLOptions.

What the options do

They restrict the certificate/signature algorithms used to authenticate the TLS connection. The key exchange is left alone.

  • OpenSSL: !aRSA / !aECDSA in the cipher list (TLS/1.2), plus SSL_CTX_set1_sigalgs_list(), which also covers TLS/1.3. On OpenSSL 3.5+ the list includes mldsa65:mldsa87:mldsa44. LibreSSL has no SSL_CTX_set1_sigalgs_list(), so there the options make _httpTLSStart fail with "No allowed signature algorithms." instead of being silently ignored under TLS/1.3. If you'd rather cap LibreSSL at TLS/1.2 instead, that's an easy change.
  • GNU TLS: removes the RSA/ECDSA key exchanges and SIGN-* algorithms from the priority string. Every keyword was checked against GNU TLS 3.8.12, because one unknown keyword makes GNU TLS reject the whole string. The PSS/RSAE/EdDSA names are guarded with GNUTLS_VERSION_NUMBER >= 0x03060c.
  • Auto-created server credentials: with DenyRSA they use ECDSA P-384 instead of the default RSA-3072. With both options set, creation fails with "No allowed key type for server credentials." because libcups can't create ML-DSA credentials yet.
  • tlscheck: new --no-rsa and --no-ecc options.
  • client.conf(5): man page and HTML updated.

I didn't touch CHANGES.md or the strings files. The two new _() messages will need a strings update.

Second commit: GNU TLS was ignoring all SSLOptions on Debian/Ubuntu

I found this while testing. The priority string starts with @SYSTEM,, and GNU TLS only accepts that when its config file defines a SYSTEM priority. Ubuntu's /etc/gnutls/config only has an [overrides] section, so gnutls_priority_set_direct() returns GNUTLS_E_INVALID_REQUEST. The return value was ignored, so every SSLOptions setting was dropped. On unpatched master with GNU TLS on Ubuntu 26.04, tlscheck --tls12 still negotiates TLS/1.3, and --no-cbc has no effect either.

The fix retries without @SYSTEM, when that happens and logs priority errors. I can split it into its own PR if you'd prefer.

Post-quantum status

On OpenSSL 3.5 (Ubuntu 26.04), libcups already negotiates the hybrid X25519MLKEM768 group (RFC 10024) by default, because it never sets the groups list. openssl s_client against ippeveprinter shows Negotiated TLS1.3 group: X25519MLKEM768. So nothing is needed for ML-KEM key exchange itself.

The certificate side is ML-DSA (FIPS 204), not ML-KEM, since ML-KEM can't sign. With these options and a manually created ML-DSA-65 certificate in the keystore, a fully post-quantum handshake works on OpenSSL 3.5:

openssl req -x509 -newkey mldsa65 -keyout localhost.key -out localhost.crt -nodes -subj /CN=localhost ...
SSLOptions DenyRSA DenyECC   (server)
tlscheck --no-rsa --no-ecc localhost 9100  ->  localhost: OK (TLS/1.3 TLS_AES_256_GCM_SHA384)
tlscheck --tls12 localhost 9100            ->  handshake failure (expected: no PQ auth in TLS/1.2)

Ubuntu's GNU TLS 3.8.12 is built without leancrypto/liboqs, so it has no ML-KEM groups and ML-DSA isn't usable there.

Testing

Ubuntu 26.04 container, configured as in CI (--enable-debug --enable-maintainer --with-sanitizer=address), OpenSSL 3.5.5 and GNU TLS 3.8.12. I tested ippeveprinter (auto-created certs) against tlscheck with each server/client combination. Both backends give the same results:

server SSLOptions client: default --no-rsa --no-ecc --no-rsa --no-ecc --tls12 --no-rsa --tls12 --no-ecc
(none), RSA cert OK fail OK fail fail OK
DenyRSA, ECDSA P-384 cert OK OK fail fail OK fail
DenyECC, RSA cert OK fail OK fail fail OK
DenyRSA DenyECC fail: no allowed key type

make test passes with both backends (GNU TLS tools: 202 tests, 79 passed, 0 failed, 123 skipped, the same as master). One note: in that container tools/ hits an ASan stack overflow in ipptool token_cb (ipptool.c:5237) with the default 8 MB stack. Unpatched master does the same and CI is green, so I ran with ulimit -s 65536.

Not in this PR

The other two items in #163, the multi-certificate store and picking the certificate in _httpTLSStart by algorithm, involve API decisions I'd rather discuss first. Two notes from testing:

  • OpenSSL and GNU TLS can both hold one certificate per key type in a single context and select by the peer's signature algorithms. So item 3 may mostly come down to loading every certificate in the store.
  • Adding CUPS_CREDTYPE_MLDSA_* (OpenSSL 3.5+, and GNU TLS with leancrypto) would make DenyRSA DenyECC work with auto-created certificates. That overlaps with Support Post-Quantum ML-DSA signing algorithm for JWS #162.

One open question: if a server already has an auto-created RSA certificate and DenyRSA is then enabled, it keeps using that certificate and every handshake fails. Should _httpTLSStart regenerate the certificate in that case, or is that better handled with the multi-certificate store?

The new options limit the certificate/signature algorithms used to
authenticate TLS connections, so that RSA and/or ECC can be disabled in
favor of post-quantum (ML-DSA) certificates:

- OpenSSL: filter aRSA/aECDSA cipher suites for TLS/1.2 and set the
  signature algorithm list (which also covers TLS/1.3).  ML-DSA is
  included with OpenSSL 3.5 and later.  LibreSSL has no way to set the
  signature algorithms, so the options cause the connection to fail
  there rather than being silently ignored.
- GNU TLS: remove the RSA/ECDSA key exchanges and signature algorithms
  from the priority string.
- Auto-created server credentials use ECDSA P-384 when RSA is denied,
  and fail with an error when both are denied.
- tlscheck gets matching --no-rsa and --no-ecc options.

Key exchange is not changed: OpenSSL 3.5 already negotiates the hybrid
X25519MLKEM768 group by default.
@michaelrsweet michaelrsweet self-assigned this Nov 24, 2026
@michaelrsweet michaelrsweet added enhancement New feature or request security Security issue labels Nov 24, 2026
@michaelrsweet michaelrsweet added this to the Future milestone Nov 24, 2026
@michaelrsweet

Copy link
Copy Markdown
Member

Not for 3.0.x

We are still waiting for proper X.509 support (i.e, Merkle trees) to get through the IETF, and then we’ll need printers to implement it, and to have proper support throughout the stack to support PQC and hybrid configurations.

I’d be interested in any GNU TLS fixes you have separately from these changes, however…

Thanks!

@rue19

rue19 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I've opened #234 with just the GNU TLS fix. It turned out CUPS had already fixed the same bug in OpenPrinting/cups#1701, so I've mirrored that change instead of the retry loop I had here. I'll drop that commit from this PR. I'm leaving the DenyRSA/DenyECC part as it is in case it's useful for 3.1 once X.509 PQC support is ready. Feel free to close it if you'd rather start fresh then.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request security Security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants