tlshd: Allow the use of post-quantum cryptography #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These patches allow tlshd to use post-quantum cryptography. The first
patch does a bit of refactoring to reduce some code duplication. The
second fixes the priority string and allows the PQ algorithms to be
used. The other two implement dual certificate support. Dual
certificates are necessary to enable a smooth transition period,
allowing servers to work with both clients that are PQ-enabled and
clients that are not. The server will prefer the ML-DSA certificate but
will fall back to the traditional certificate for clients that do not
support ML-DSA.
To use these patches, you need a recent version of gnutls as well as
crypto-policies (if used by your distro). These commands will help you
determine if your gnutls has the necessary stuff:
You'll need to generate a cert using ML-DSA-44/ML-DSA-65/ML-DSA-87. For
example, here's how I generate a self-signed cert using ML-DSA-65:
Obviously if you're using openssl to generate your certs, you'll need a
recent openssl too. Or you can use certtool if you prefer the gnutls
utilities.
You'll need to add the cert and key to the relevant sections of
tlshd.conf and you should be good to go.
If you have debug logging turned on, you should see this if you perform a
handshake with a PQ-enabled peer you should see something like this:
Aug 28 17:58:25 rhel10.smayhew.test tlshd[3291]: Session description: (TLS1.3)-(HYBRID-X25519-MLKEM768)-(ML-DSA-65)-(AES-256-GCM)
and if you perform a handshake with a non-PQ-enabled peer:
Aug 28 18:04:21 rhel10.smayhew.test tlshd[3352]: Session description: (TLS1.3)-(ECDHE-X25519)-(RSA-PSS-RSAE-SHA256)-(AES-256-GCM)