Hugo Landau [Thu, 21 Mar 2024 10:47:21 +0000 (10:47 +0000)]
Minor fixes
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 21 Mar 2024 10:44:04 +0000 (10:44 +0000)]
Minor doc fix
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Sun, 10 Mar 2024 00:29:07 +0000 (00:29 +0000)]
QUIC APL: Avoid having a mutex variable where not needed
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Sun, 10 Mar 2024 00:19:43 +0000 (00:19 +0000)]
QUIC OBJ: Use QUIC_OBJ pointer for parent references
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Sat, 9 Mar 2024 12:16:51 +0000 (12:16 +0000)]
Post-rebase fixes
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 17:22:53 +0000 (17:22 +0000)]
QUIC APL: Fix bug around default XSO handling on server side
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 17:32:51 +0000 (17:32 +0000)]
QUIC APL: Fix refcounting for listeners
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 16:31:23 +0000 (16:31 +0000)]
QUIC PORT: Allow QUIC_PORT to throw away incoming connections
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 16:17:37 +0000 (16:17 +0000)]
QUIC APL: Fix server API bugs discovered during test
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 14:38:04 +0000 (14:38 +0000)]
QUIC APL: Implement SSL_get0_listener
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 14:19:46 +0000 (14:19 +0000)]
QUIC APL: Free listeners correctly
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Mon, 5 Feb 2024 13:34:01 +0000 (13:34 +0000)]
QUIC APL: Fix QUIC_TLS free order
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 18 Jan 2024 16:33:27 +0000 (16:33 +0000)]
Minor fix to BIO refcount handling
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 18 Jan 2024 15:31:41 +0000 (15:31 +0000)]
Minor fixes
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 18 Jan 2024 15:23:38 +0000 (15:23 +0000)]
QUIC APL: Add TODOs for unfinished listener APIs
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 18 Jan 2024 14:36:30 +0000 (14:36 +0000)]
QUIC: Add manpage for listener API
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 18 Jan 2024 13:56:24 +0000 (13:56 +0000)]
make update
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 15:22:59 +0000 (15:22 +0000)]
QUIC APL: Refactor block_until_pred
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 13:20:05 +0000 (13:20 +0000)]
QUIC APL: Implement base listener API, move addressing mode handling into PORT
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 10:21:37 +0000 (10:21 +0000)]
QUIC APL: Rework QCTX to support listener calls
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 09:33:36 +0000 (09:33 +0000)]
QUIC APL: Add skeleton listener API methods
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 09:17:43 +0000 (09:17 +0000)]
QUIC APL: Add skeleton listener API
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 09:06:55 +0000 (09:06 +0000)]
QUIC APL: Make use of QUIC_OBJ infrastructure
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 08:36:15 +0000 (08:36 +0000)]
libssl: Move SSL object unwrapping macros to separate header
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 07:52:43 +0000 (07:52 +0000)]
QUIC APL: Introduce the QUIC_OBJ base type and infrastructure
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Hugo Landau [Thu, 11 Jan 2024 07:39:10 +0000 (07:39 +0000)]
QUIC APL: Introduce QUIC listener SSL object type (QLSO)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
Viktor Dukhovni [Fri, 14 Feb 2025 06:22:01 +0000 (17:22 +1100)]
Consolidate ML-KEM and ML-DSA codecs
These previously duplicated some code and structures, now shared.
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26764)
Viktor Dukhovni [Thu, 13 Feb 2025 15:07:14 +0000 (02:07 +1100)]
Accessors for the IANA signature scheme name
This is the official name of the signature algorithm(s) used by the peer
and/or local end of the connection, and should be available, e.g. for
logging.
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26738)
Viktor Dukhovni [Sat, 15 Feb 2025 04:57:48 +0000 (15:57 +1100)]
Address non-FP coverity nits
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26765)
Simo Sorce [Tue, 14 Jan 2025 22:53:28 +0000 (17:53 -0500)]
Add additional EVP_SKEY helpers
EVP_SKEY_is_a() allows to check if a key is of a specific type.
EVP_SKEY_to_provider() provides an easy way to move a key to a
different provider.
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26753)
Simo Sorce [Mon, 13 Jan 2025 23:02:55 +0000 (18:02 -0500)]
Allow import of unknown keys via generic type
This allows to use SKEY even w/o a specific skey managment available,
however it bears the risk of allowing users to mispell the key type
and not see the error of their ways until they expect a specific
provider to pick this up and fail.
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26753)
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com> Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26753)
Simo Sorce [Tue, 28 Jan 2025 18:06:28 +0000 (13:06 -0500)]
Add skeymgmt helper to fetch from a provider
This allows to fetch efficiently directly from the same provider that can
handle the EVP_SKEY at hand.
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26753)
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com> Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26753)
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com> Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26753)
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com> Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26753)
Design document of using opaque object as symmetric key
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com> Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26753)
Andrew Dinh [Fri, 14 Feb 2025 12:15:50 +0000 (19:15 +0700)]
Add an initial ML-DSA fuzzer
Add an initial version of an ML-DSA fuzzer. Exercises various ML-DSA
appropriate APIs. Currently it is able to randomly:
1. Attempt to create raw public private keys of various valid and invalid sizes
2. Generate legitimate keys of various sizes using the keygen api
3. Perform sign/verify operations using real generated keys
4. Perform digest sign/verify operations using real generated keys
5. Do an export and import of a key using todata/fromdata
6. Do a comparison of two equal and unequal keys
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26685)
When we try to get a group, we need session to be valid
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26722)
slontis [Mon, 10 Feb 2025 07:06:17 +0000 (18:06 +1100)]
ML-DSA: Change ossl_ml_dsa_key_public_from_private() to check that the
decoded value of t0 matches the calculated value of t0.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26681)
Pauli [Wed, 12 Feb 2025 00:49:22 +0000 (11:49 +1100)]
rand: avoid property query manipulations
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:14:08 +0000 (10:14 +1100)]
sslapitest: include hybrid KEM tests with FIPS
Co-Authored-By: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Wed, 12 Feb 2025 02:34:56 +0000 (13:34 +1100)]
fips: include ML-KEM capabilities in FIPS provider
Co-Authored-By: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:13:36 +0000 (10:13 +1100)]
fips: add hybrid KEM algorithms to the FIPS provider
Co-Authored-By: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Wed, 12 Feb 2025 00:15:35 +0000 (11:15 +1100)]
evp: add additional functions for FIPS internal use to support hybrids KEMs
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:10:54 +0000 (10:10 +1100)]
evp: include one shot keygen functions for internal FIPS use
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:09:47 +0000 (10:09 +1100)]
mlkem: include hybrid KEM algs in FIPS provider
Co-Authored-By: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:10:06 +0000 (10:10 +1100)]
mlkem: include hybrid KEYMGMT algs in FIPS provider
Co-Authored-By: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
Pauli [Tue, 11 Feb 2025 23:08:09 +0000 (10:08 +1100)]
fips: FIPS ignores property queries for internal algorithm fetches
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26714)
SPARC assembly: Don't file aes-cbc on T4 with small sizes.
The "openssl speed -testmode -seconds 1 -bytes 1 aes-128-cbc" test
revealed that the assembly code is crashing if length is less than 16.
The code shifts the provided length by 4 and than subtracts one until
the length hits zero. If it was already zero then it underflows the
counter and continues until it segfaults on reading or writing.
Replace the check against 0 with less than 15.
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25637)
Xi Ruoyao [Wed, 12 Feb 2025 08:42:00 +0000 (16:42 +0800)]
LoongArch: Fix output file name detection for Perl scripts
We were using the first (or second) argument containing a '.' as the
output name file, but it may be incorrect as -march=la64v1.0 may be in
the command line. If the builder specifies -march=la64v1.0 in the
CFLAGS, the script will write to a file named "-march=la64v1.0" and
cause a build error with cryptic message:
ld: crypto/pem/loader_attic-dso-pvkfmt.o: in function `i2b_PVK':
.../openssl-3.4.1/crypto/pem/pvkfmt.c:1070:(.text+0x11a8): undefined reference to `OPENSSL_cleanse'
Adapt the approach of ARM and RISC-V (they have similar flags like
-march=v8.1-a or -misa-spec=2.2) to fix the issue.
Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26717)
Viktor Dukhovni [Wed, 12 Feb 2025 06:06:20 +0000 (17:06 +1100)]
Left over doc TODOs
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26715)
Viktor Dukhovni [Wed, 12 Feb 2025 04:26:35 +0000 (15:26 +1100)]
Post-merge make update
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26715)
Viktor Dukhovni [Fri, 7 Feb 2025 08:16:33 +0000 (19:16 +1100)]
Two more private key checks.
- When a PKCS#8 has both seed and key cross check the implicit
rejection value |z|
- When an import (EVP_PKEY_fromdata call) provides both a private
and public key, fail if the redundant public key does not match
the copy in the private key.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26656)
Viktor Dukhovni [Thu, 6 Feb 2025 09:07:11 +0000 (20:07 +1100)]
Reject import of private keys that fail PCT
- Also added a provider "validate" method that wraps the PCT test.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26656)
Neil Horman [Thu, 6 Feb 2025 13:37:49 +0000 (08:37 -0500)]
Update corpora to include ml-kem seed corpus
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26657)
Neil Horman [Tue, 4 Feb 2025 21:14:57 +0000 (16:14 -0500)]
Add an inital ML-KEM fuzzer
Add an inital version of an ML-KEM fuzzer. Exercises various ML-KEM
appropriate apis, as a fuzzer does. Currently it is able to randomly:
1) Attempt to create raw public private keys of various valid and
invalid sizes
2) Generate legitimate keys of various sizes using the keygen api
3) Preform encap/decap operations using real generated keys
4) Do a shared secret derivation using 2 keys
5) Do an export and import of a key using todata/fromdata
6) Do a comparison of two equal and unequal keys
Its not much to start, but it should be fairly extensible
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26657)
Viktor Dukhovni [Wed, 5 Feb 2025 05:30:15 +0000 (16:30 +1100)]
ASN.1 format tagging seed, key now octet string
- The main ASN.1 private key syntax is the one from Russ Housley's post
on the LAMPS list, subsequently amended to tag the seed instead of the
key (each of the three parameter sets will have a fixed size for the
`expandedKey`):
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26639)
Viktor Dukhovni [Mon, 27 Jan 2025 16:12:47 +0000 (03:12 +1100)]
Implement seed/key preference when decoding
- Moved the codec code out of `ml_kem.c` into its own file in
the provider tree. Will be easier to share some code with
ML-DSA, and possible to use PROV_CTX, to do config lookups
directly in the functions doing the work.
- Update and fixes of the EVP_PKEY-ML-KEM(8) documentation, which
had accumulated some stale/inaccurate material, and needed new
text for the "prefer_seed" parameter.
- Test the "prefer_seed=no" behaviour.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26569)
Viktor Dukhovni [Fri, 17 Jan 2025 16:28:51 +0000 (03:28 +1100)]
Improved import and export
- On import, if a seed is provided, the keys are regenerated.
- The seed is exported as a separate "seed" parameter, when available.
The "ml-kem.retain_seed" parameter is also exported, when false.
- The seed is optionally dropped after key generation.
* When the "ml-kem.retain_seed" keygen parameter is set to zero.
* When the "ml-kem.retain_seed" keygen parameter is not set to 1,
and the "ml-kem.retain_seed" provider config property is set
explictly false.
- The exported private key parameter "priv" is always the FIPS 203 |dk|.
- Private key decoding from PKCS#8 produces a transient "seed-only" form
of the key, in which "retain_seed" is set to false when the
"ml-kem.retain_seed" provider config property is set explictly false.
The full key is generated during "load" and the seed is retained
or not as specified.
- Import honours the "ml-kem.retain_seed" parameter when specified, or
otherwise honours the provider's "ml-kem.retain_seed" property.
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26512)