All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] tlshd: Allow the use of post-quantum cryptography
@ 2025-09-11 21:28 Scott Mayhew
  2025-09-11 21:28 ` [PATCH v2 1/4] tlshd: deduplicate client and server config functions Scott Mayhew
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Scott Mayhew @ 2025-09-11 21:28 UTC (permalink / raw)
  To: chuck.lever; +Cc: kernel-tls-handshake

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.

Changes since v1:
- Refactoring to allow the client and server code to use the same
  tlshd_config_get_* functions
- Removed a lot of "#ifdef HAVE_GNUTLS_MLDSA" statements (I'm pretty
  sure the handful that are left are necessary)
- Store both the PQ and RSA certs in the same array.  The PQ certs (if
  present) will be first, followed by the RSA certs.  Note that I didn't
  increase TLSHD_MAX_CERTS though.

For those who prefer a web UI, these patches are also available in this
branch:
https://github.com/scottmayhew/ktls-utils/tree/pqc

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:

$ gnutls-cli -l | grep ML-DSA
$ gnutls-cli -l | grep MLKEM

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:

$ openssl req -new -x509 -newkey mldsa65 -days 365 \
	-keyout /etc/pki/tls/private/rhel10.smayhew.test.mldsa65.key \
	-out /etc/pki/tls/certs/rhel10.smayhew.test.mldsa65.pem \
	-subj "/CN=rhel10.smayhew.test" \
	-addext "subjectAltName=DNS:rhel10.smayhew.test,IP:192.168.124.69" \
	-noenc -quiet

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)

-Scott

Scott Mayhew (4):
  tlshd: deduplicate client and server config functions
  tlshd: Fix priority string to allow PQC
  tlshd: Server-side dual certificate support
  tlshd: Client-side dual certificate support

 configure.ac             |  12 ++
 src/tlshd/client.c       |  48 +++++--
 src/tlshd/config.c       | 281 +++++++++++++++++++--------------------
 src/tlshd/ktls.c         |   2 +-
 src/tlshd/server.c       |  74 ++++++++++-
 src/tlshd/tlshd.conf     |   4 +
 src/tlshd/tlshd.conf.man |  15 +++
 src/tlshd/tlshd.h        |  23 ++--
 8 files changed, 286 insertions(+), 173 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-10-02 18:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11 21:28 [PATCH v2 0/4] tlshd: Allow the use of post-quantum cryptography Scott Mayhew
2025-09-11 21:28 ` [PATCH v2 1/4] tlshd: deduplicate client and server config functions Scott Mayhew
2025-09-11 21:28 ` [PATCH v2 2/4] tlshd: Fix priority string to allow PQC Scott Mayhew
2025-10-01  3:37   ` Alistair
2025-10-01 10:58     ` Scott Mayhew
2025-10-01 23:35     ` [PATCH] tlshd: fix priority cache initialization Scott Mayhew
2025-10-02  0:22       ` Alistair Francis
2025-10-02  5:28       ` Hannes Reinecke
2025-10-02 18:50         ` Chuck Lever
2025-09-11 21:28 ` [PATCH v2 3/4] tlshd: Server-side dual certificate support Scott Mayhew
2025-09-11 21:28 ` [PATCH v2 4/4] tlshd: Client-side " Scott Mayhew
2025-09-12 14:35 ` [PATCH v2 0/4] tlshd: Allow the use of post-quantum cryptography Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.