Skip to content

feat(pqc): add native Post-Quantum Cryptography support to Easy-RSA - #1432

Open
jaberansariali wants to merge 4 commits into
OpenVPN:masterfrom
jaberansariali:pqc-support
Open

jaberansariali wants to merge 4 commits into
OpenVPN:masterfrom
jaberansariali:pqc-support

Conversation

@jaberansariali

Copy link
Copy Markdown

Summary

This PR introduces first-class Post-Quantum Cryptography (PQC) support
to Easy-RSA, enabling generation and verification of PQC and hybrid
certificates using NIST-standardized algorithms.

Key Features

  • New pqc algorithm mode via EASYRSA_ALGO=pqc
  • Support for NIST PQC standards:
    • ML-DSA (FIPS 204)
    • ML-KEM (FIPS 203)
    • SLH-DSA (FIPS 205)
    • Falcon (FIPS 206)
    • Hybrid classical + PQC algorithms
  • Automatic OpenSSL capability checks (OpenSSL ≥ 3.5 or OQS provider)
  • New PQC CLI commands:
    • list-pqc, pqc-status, pqc-set-algo
    • pqc-recommend, pqc-key-info, pqc-verify
    • pqc-migration, pqc-help
  • Clear prevention of silent fallback to legacy RSA/EC algorithms
  • Documented configuration in vars.example

Motivation

Easy-RSA currently supports only classical cryptography. With NIST PQC
standards finalized, adding native PQC support enables forward security
and crypto-agility for long-lived PKI deployments.

Compatibility

  • Existing RSA/EC workflows are unaffected
  • PQC is opt-in only
  • Hybrid mode ensures backward compatibility

Requirements

  • OpenSSL 3.5+ or
  • Open Quantum Safe provider (oqsprovider)

Testing

  • Generated PQC CA using ML-DSA-65
  • Verified certificate signature and public key algorithms
  • Tested hybrid and pure PQC modes

@jaberansariali

Copy link
Copy Markdown
Author

Hi @TinCanTech,

Thank you for the feedback and for re-opening this in the new PR. I apologize for the initial confusion; I closed the first PR to ensure I was submitting from a dedicated branch rather than master, following the contributing guidelines.

I’m glad to hear this is being considered for the long term. I’m fully available to discuss the implementation, make adjustments based on your review, or split the changes into smaller parts if that helps the review process.

Looking forward to making Easy-RSA quantum-ready with your guidance!

@TinCanTech

Copy link
Copy Markdown
Collaborator

@jaberansariali thank you for this PR.

It will take some time to review, so please be patient.

@TinCanTech TinCanTech linked an issue Feb 23, 2026 that may be closed by this pull request
@jabalf15ai

This comment was marked as off-topic.

@spatterIight

Copy link
Copy Markdown

https://words.filippo.io/crqc-timeline/

Based on the above article I think this would be a really much needed improvement! Thank you

@TinCanTech

Copy link
Copy Markdown
Collaborator

@jaberansariali FTR, init-pki pqc does not work.

Error: append PQC vars

Directions:

  • The above error is caused by use of conditional &&, which must be replaced by a full if/then..
  • EasyRSA does not use test [ -n string ], please drop the -n.

Also, I'm not happy for EasyRSA to maintain text lists of PQC algorithms.
This section will not be accepted as-is:

# ============================================================
# Post-Quantum Cryptography (PQC) Support for OpenSSL 3.5+
# ============================================================
# NIST-standardized and candidate post-quantum / hybrid algorithms
# supported by OpenSSL 3.5+ via built-in PQC or the OQS provider.
# ============================================================

# --- PQC Algorithm Definitions ---

...

- Updated comments to clarify the selection of PQC signature algorithms.
- Removed specific examples of PQC algorithms and emphasized the use of the active OpenSSL provider.
- Adjusted instructions for loading a named PQC provider and specifying the provider module directory.
@jaberansariali

Copy link
Copy Markdown
Author

Dear @TinCanTech

Thanks for the feedback. I’ve pushed a follow-up commit addressing these points:

  • Replaced the conditional && expressions in the init-pki pqc path with full if/then blocks.
  • Removed the -n string tests and now use Easy-RSA’s existing [ "$var" ] style.
  • Removed the maintained lists of PQC algorithm names. Easy-RSA now queries the active OpenSSL providers at runtime for the available signature and KEM algorithms.
  • Updated vars.example and the PQC help text so they no longer contain a hard-coded algorithm inventory.
  • Centralized the OpenSSL provider arguments through a wrapper so the selected provider and provider path are applied consistently.

The changes are in commit a461461.

Please let me know whether this runtime provider-based approach matches the direction you had in mind, or whether you would prefer any further adjustments.

@TinCanTech

TinCanTech commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

@jaberansariali in easyrsa function ssl_cert_digest(), which is used by command renew, does not support PQC algorithms. What would be the way to verify that the algorithm is supported by PQC ?

Example: if pqc_is_valid_algo "$fn_ssl_out"; then ...

Example patch:

diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa
index 12494c2..1052143 100755
--- a/easyrsa3/easyrsa
+++ b/easyrsa3/easyrsa
@@ -6310,7 +6310,14 @@ ssl_cert_digest() {
                        fn_ssl_out=""
                        # digest verification is not required
                ;;
-               *) die "ssl_cert_digest - Unknown Sig-Alg: '$fn_ssl_out'"
+               *)
+                       if pqc_is_valid_algo "$fn_ssl_out"; then
+                               # do what ?
+                               :
+                               die "ssl_cert_digest - Unknown Sig-Alg: '$fn_ssl_out'"
+                       else
+                               die "ssl_cert_digest - Unknown Sig-Alg: '$fn_ssl_out'"
+                       fi
        esac

        force_set_var "$2" "$fn_ssl_out" || \

علی جابرانصاری added 2 commits August 15, 2026 11:27
- prevent silent fallback to the default provider
- avoid exposing private key material
- propagate certificate verification failures
- fix encrypted PQC request generation
- update diagnostics, help, and documentation
@jaberansariali

Copy link
Copy Markdown
Author

Hi @TinCanTech, thank you for pointing this out.

I addressed ssl_cert_digest() in commit 7bbcae1. It now calls the existing is_pqc_sig_algo "$fn_ssl_out" predicate, which validates the signature algorithm against the selected OpenSSL provider at runtime without introducing a hard-coded algorithm list.

When the algorithm is recognized as PQC, fn_ssl_out is cleared, similar to Ed25519/Ed448, so the selected provider can handle its required digest behavior. Unknown signature algorithms still fail as before.

I verified both renew and renew-ca with native ML-DSA and SLH-DSA algorithms.

I also pushed follow-up commit 10e7c67, which:

  • prevents silent fallback to the default provider;
  • fixes encrypted PQC request generation;
  • prevents pqc-key-info from exposing private key material;
  • propagates pqc-verify failures correctly;
  • updates the diagnostics, help text, and documentation.

Testing included all native ML-DSA and SLH-DSA variants, mixed classical/PQC PKIs, encrypted keys, renew/revoke/CRL workflows, and a complete external oqsprovider workflow using falcon512. The official op-test.sh -vv -p suite completed with zero errors.

Please let me know if this runtime validation approach matches what you had in mind.

@TinCanTech TinCanTech added the development Possible changes label Aug 15, 2026
@TinCanTech

Copy link
Copy Markdown
Collaborator

@jaberansariali would you be prepared to break up your initial commit ?

I prefer to see the following:

  • Introduce command line parameter parsing.
  • Introduce PQC functions.
  • Integrate PQC into script.

I also have intermediate details for each step and some changes that may be tricky ..

@jaberansariali

Copy link
Copy Markdown
Author

@TinCanTech
Thanks, that makes sense. I agree with splitting the changes into the three steps you suggested.
I'll restructure the PR accordingly. Please share the intermediate details and any tricky changes you have in mind for each step, and I'll work through them step by step.

@TinCanTech

TinCanTech commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

@jaberansariali I continue the review..

Do you have any relevant documentation regarding this:

# For PQC, generate key and req separately
# because -newkey may not work with all PQC algorithms

It is found in gen_req().

It may be simpler to generate key and request files separately for all CSRs.

Edit: Resovled. (See 58df374)

@TinCanTech TinCanTech mentioned this pull request Sep 10, 2026
@jaberansariali

Copy link
Copy Markdown
Author

Hi @TinCanTech,

I see you've already marked this as resolved, but just to add a bit of context: openssl req -newkey can be quite unreliable when routing specific parameters to external providers (like oqsprovider for PQC) and parsing newer algorithm names. Using openssl genpkey as a dedicated first step is much more robust for these implementations.

@TinCanTech

Copy link
Copy Markdown
Collaborator

@jaberansariali Please keep this PR as it is now, for full credit on merge.

@randolf

randolf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

We need ML-DSA-87 ("mldsa87"). I noticed ML-DSA-65 was mentioned, and I'm willing to help with testing of 87.

@TinCanTech

Copy link
Copy Markdown
Collaborator

@randolf You can test this branch #1460

That will apply to master branch.

@randolf

randolf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Thank you @TinCanTech; I will try that now.

@randolf

randolf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@TinCanTech: This is some progress, which is great, but I've encountered a challenge (version information is included at the end)...

root@test02:/etc/openvpn/ca# ./easyrsa init-pki

Notice
------
'init-pki' complete; you may now create a CA or requests.

Your newly created PKI dir is:
* /etc/openvpn/ca/pki

IMPORTANT: PKI algorithm is 

Using Easy-RSA Auto-configured 'vars' file:
* /etc/openvpn/ca/vars

root@test02:/etc/openvpn/ca# ./easyrsa build-ca nopass
Using Easy-RSA 'vars' configuration:
* /etc/openvpn/ca/vars

EasyRSA version git-development

Error
-----
Algorithm 'pqc' is invalid: Must be 'rsa', 'ec' or 'ed'

The ./easyrsa init-pki command works, but the ./easyrsa build-ca nopass fails (as does the ./easyrsa gen-tls-crypt-key command, and probably others too, like ./easyrsa build-server-full vpn.example.com nopass which I also need).

These lines are in my vars file:

set_var EASYRSA_PQC_PROVIDER openssl
set_var EASYRSA_ALGO         pqc
set_var EASYRSA_PQC_ALGO     mldsa87

Relevant version information obtained from the ./easyrsa version command:

EasyRSA Version Information
Version:     git-development
Generated:   Sun 22 Nov 2026 10:39:21 AM MST
SSL Lib:     OpenSSL 3.5.9 29 Sep 2026 (Library: OpenSSL 3.5.9 29 Sep 2026)
Git Commit:  0ad2602f9b644971ccd7caf34ac3daa58f82238c
Source Repo: https://github.com/OpenVPN/easy-rsa

@TinCanTech

Copy link
Copy Markdown
Collaborator

@randolf Try using command:

$ ./easyrsa init-pki pqc mldsa87

@randolf

randolf commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

@TinCanTech: I tried but it failed, so I deleted /etc/openvpn/ca/ and ran started anew (with make-cadir /etc/openvpn/ca and re-edited vars), but still get the same error:

root@test02:/etc/openvpn/ca# ./easyrsa init-pki pqc mldsa87

EasyRSA version git-development

Error
-----
Failed to verify ecparams for curve 'mldsa87'

Is there an updated file I should be using? If there's a git command I should use to update what I've downloaded, perhaps I need this in case I didn't get the branch properly? Thanks.

I'm using Debian Trixie with all current updates, and extrepo brings in the newest official release of OpenVPN.

@TinCanTech

Copy link
Copy Markdown
Collaborator

I will refer you back to this comment:

#1432 (comment)

@randolf

randolf commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

I guess I'm not getting the branch. I need to figure this out with the proper git commands -- specifying 1460 or pqc-support-intro results in a "branch not found" error. Google hasn't been very helpful with this either, but I'll keep trying to get the branch downloaded.

root@test02:~/git# git clone -b pqc-support-intro https://www.github.com/OpenVPN/easy-rsa/
Cloning into 'easy-rsa'...
warning: redirecting to https://github.com/OpenVPN/easy-rsa.git/
fatal: Remote branch pqc-support-intro not found in upstream origin

@TinCanTech

TinCanTech commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

See: #1460 (comment)

@randolf

randolf commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Thanks @TinCanTech -- building from the branch made the difference. I just successfully set up the CA (using the ./easyrsa init-pki pqc mldsa87 command), and also created a client.

Interestingly, the EASYRSA_REQ_CN variable is being ignored by build-ca (and defaulting to "Easy-RSA CA"), but this is not a problem for me because I can easily type in the server's hostname here:

Common Name (eg: your user, host, or server name) [Easy-RSA CA]:vpn.example.com

I will proceed with setting up the OpenVPN server and client now, and report back here shortly on the outcome.

@TinCanTech

TinCanTech commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Interestingly, the EASYRSA_REQ_CN variable is being ignored by build-ca

Works perfectly for me ..

@randolf Please set your follow-ups to #1433

@randolf

randolf commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

This is all working now, thanks to your help @TinCanTech -- thank you so very much for your help today! (I'm not sure how to set follow-ups in GitHub, but I'll attempt a Google Search for instructions.)

Here are the configuration files I'm using on server and client, which are successfully using ML-DSA-87 (thanks to your changes that support ./easyrsa init-pki pqc mldsa87), and only using post-quantum cryptography tls-groups and TLS v1.3 with the appropriate ciphers, as confirmed in OpenVPN's server-side log file:

Control Channel: TLSv1.3,
   cipher TLSv1.3 TLS_AES_256_GCM_SHA384,
   peer certificate: 20736 bits ML-DSA-87,
   signature: id-ml-dsa-87,
   peer temporary key: 768 bits ML-KEM-768,
   peer signing digest/type: mldsa87 id-ml-dsa-87,
   key agreement: MLKEM768

Server-side file: /etc/openvpn/server.conf

Client-side file: /etc/openvpn/randolf.conf

I hope that this will be helpful to anyone who is wanting to do this. (Please feel free to include what I posted in documentation that can be helpful by serving as a working example.)

@TinCanTech

TinCanTech commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

I'm not sure how to set follow-ups

Post further PQC:On-Topic comments to the referenced issue.

@OpenVPN OpenVPN locked and limited conversation to collaborators Nov 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post Quantum Cryptography - Phase One.

5 participants