]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
5 months agoriscv: add dl_hwcap for capability detection
daichengrong [Tue, 18 Feb 2025 08:19:01 +0000 (16:19 +0800)] 
riscv: add dl_hwcap for capability detection

Availability of ZVK* should be determined with dl_hwcap and hwcap.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26811)

5 months agofix: add OOM handler for x509 fuzz test
Burkov Egor [Wed, 19 Feb 2025 13:42:07 +0000 (16:42 +0300)] 
fix: add OOM handler for x509 fuzz test

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26830)

5 months agoMake the KEM operating mode optional
Viktor Dukhovni [Sun, 23 Feb 2025 04:21:14 +0000 (15:21 +1100)] 
Make the KEM operating mode optional

There is only one operating mode supported for each of RSA, EC and ECX.
We should not require an explicit setting for the obvious default.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26872)

5 months agodoc: document that the FIPS provider doesn't support deterministic ECDSA sigs
Pauli [Mon, 24 Feb 2025 04:20:34 +0000 (15:20 +1100)] 
doc: document that the FIPS provider doesn't support deterministic ECDSA sigs

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26880)

5 months agoRevert wrong macos RCU fix
Bernd Edlinger [Mon, 24 Feb 2025 06:51:16 +0000 (07:51 +0100)] 
Revert wrong macos RCU fix

This reverts #23974 which seems to be no longer needed now,
due to other fixes nearby.  Most likely the change did just
slightly decrease the performance of the reader threads, and
did therefore create the wrong impression that it fixed the issue.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26881)

5 months agoCoverity fixes
Andrew Dinh [Thu, 20 Feb 2025 07:24:21 +0000 (14:24 +0700)] 
Coverity fixes

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643042
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643047
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643089
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643091
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643095

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26845)

5 months agoMore seed and private key checks for ML-DSA
Viktor Dukhovni [Fri, 21 Feb 2025 08:47:36 +0000 (19:47 +1100)] 
More seed and private key checks for ML-DSA

- Check seed/key consistency when generating from a seed and the private
  key is also given.
- Improve error reporting when the private key does not match an
  explicit public key.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26865)

5 months agoFix ci break on building quic with no-siphash
Neil Horman [Sun, 23 Feb 2025 21:03:28 +0000 (16:03 -0500)] 
Fix ci break on building quic with no-siphash

SHARED_SOURCE doesn't pull in siphash if its disabled in the
configuration leading to undefined symbols, which we need for quic.

If siphash is disabled in the build, then pull it in via a SOURCE
addition, otherwise pull it in via SHARED_SOURCE

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26874)

5 months agoseparate intval into separate variable in OSSL_PARAMS
Neil Horman [Thu, 20 Feb 2025 14:15:26 +0000 (09:15 -0500)] 
separate intval into separate variable in OSSL_PARAMS

construction of int params holds a pointer to an int rather than an int
value, so we need to use separate variables when constructing separate
int params.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26851)

5 months agoFix slh-dsa fuzzer on invalid param inputs
Neil Horman [Thu, 20 Feb 2025 12:45:50 +0000 (07:45 -0500)] 
Fix slh-dsa fuzzer on invalid param inputs

oss-fuzz issue:
https://issues.oss-fuzz.com/issues/397734693

Fails because the fuzzer occasionaly provides inputs which drives the
fuzzer to create an octet-string for the context_string param which
violates the 255 byte constraint documented on that parameter.

Fix it by detecting that condition, expecting failure in the call to
EVP_sign_message_init, and bailing out when it occurs.

Fixes openssl/project#1109

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26851)

5 months agoUse siphash to implement lcidm hash function
Neil Horman [Thu, 20 Feb 2025 15:37:30 +0000 (10:37 -0500)] 
Use siphash to implement lcidm hash function

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26849)

5 months agoAdd siphash to shared source for quic
Neil Horman [Thu, 20 Feb 2025 14:55:21 +0000 (09:55 -0500)] 
Add siphash to shared source for quic

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26849)

5 months agoUpdate LCIDM lookups to include hash keys
Neil Horman [Wed, 19 Feb 2025 21:38:40 +0000 (16:38 -0500)] 
Update LCIDM lookups to include hash keys

In preparation for using siphash in our hash function

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26849)

5 months agoAdd random hash key value to lcidm struct
Neil Horman [Wed, 19 Feb 2025 21:17:45 +0000 (16:17 -0500)] 
Add random hash key value to lcidm struct

This is in preparation for using siphash to compute lcidm hash table
values

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26849)

5 months agoRe-enable RCU torture test on MACOSX
Bernd Edlinger [Wed, 19 Feb 2025 17:55:42 +0000 (18:55 +0100)] 
Re-enable RCU torture test on MACOSX

This test was disabled due to "Stochastic failures in
the RCU test on MACOSX" by #23967, which sounds like an
issue that is probably fixed now.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26834)

5 months agoSLH-DSA - restrict keygen seed length to exact value of 3*n
slontis [Thu, 20 Feb 2025 21:54:36 +0000 (08:54 +1100)] 
SLH-DSA - restrict keygen seed length to exact value of 3*n

It was allowing the seed to be larger, and then just ignoring the
trailing bytes.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26858)

5 months agoSLH-DSA fixup tests to adjust the private key getter returning the
slontis [Thu, 20 Feb 2025 02:39:48 +0000 (13:39 +1100)] 
SLH-DSA fixup tests to adjust the private key getter returning the
public component

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26839)

5 months agoSLH-DSA Update private key getter to also return public components.
slontis [Thu, 20 Feb 2025 01:31:23 +0000 (12:31 +1100)] 
SLH-DSA Update private key getter to also return public components.

The private key is defined in FIPS 205 as containing the public key,
so we return this also. This also matches what happens in fromdata.

Updated Documentation for SLH_DSA.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26839)

5 months agodoc: fixup FIPS self test names
Pauli [Fri, 21 Feb 2025 01:22:15 +0000 (12:22 +1100)] 
doc: fixup FIPS self test names

Missing names and categories in the documentation

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofipsinstall: update tests to use corrent key gen test name
Pauli [Fri, 21 Feb 2025 01:21:48 +0000 (12:21 +1100)] 
fipsinstall: update tests to use corrent key gen test name

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: update FIPS self test defines
Pauli [Fri, 21 Feb 2025 01:21:26 +0000 (12:21 +1100)] 
fips: update FIPS self test defines

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: refactor to unify the ST_KAT_PARAM -> OSSL_PARAM code
Pauli [Fri, 21 Feb 2025 00:37:43 +0000 (11:37 +1100)] 
fips: refactor to unify the ST_KAT_PARAM -> OSSL_PARAM code

This code was duplicated multiple times throughout the self tests.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: refactor ML-KEM tests so that key generation is separate
Pauli [Fri, 21 Feb 2025 00:36:56 +0000 (11:36 +1100)] 
fips: refactor ML-KEM tests so that key generation is separate

Encapsulation and decapsulation remain as their own CAST.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: add key generation name for ML-KEM CASTs
Pauli [Fri, 21 Feb 2025 00:36:48 +0000 (11:36 +1100)] 
fips: add key generation name for ML-KEM CASTs

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agoUse linux-arm64 or the public ubuntu-24.04-arm runner image
Bernd Edlinger [Thu, 20 Feb 2025 12:52:19 +0000 (13:52 +0100)] 
Use linux-arm64 or the public ubuntu-24.04-arm runner image

dependent on whether this runs on the openssl/openssl repository
or a clone.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26855)

5 months agoVarious NULL checks
Andrew Dinh [Thu, 20 Feb 2025 05:24:00 +0000 (12:24 +0700)] 
Various NULL checks

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643035
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643039
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643041
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643044
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643045
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643046

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26840)

5 months agoEVP_SKEY_get_raw_key => EVP_SKEY_get0_raw_key
Dmitry Belyavskiy [Wed, 19 Feb 2025 14:40:00 +0000 (15:40 +0100)] 
EVP_SKEY_get_raw_key => EVP_SKEY_get0_raw_key

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26832)

5 months agoUpdate oqsprovider git submodule and start testing with it again
Michael Baentsch [Thu, 20 Feb 2025 10:35:09 +0000 (11:35 +0100)] 
Update oqsprovider git submodule and start testing with it again

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26848)

5 months agoProvide aliases to ML-DSA without dashes
Clemens Lang [Thu, 20 Feb 2025 14:04:51 +0000 (15:04 +0100)] 
Provide aliases to ML-DSA without dashes

oqsprovider did not use dashes in the algorithm names for ML-DSA. Make
the transition smoother by also accepting the names without dashes as
aliases.

See also #26326 for the same thing for ML-KEM.

Signed-off-by: Clemens Lang <cllang@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26853)

5 months agoMake CRYPTO_atomic_load/store use the same preprocessor guards
Bernd Edlinger [Wed, 19 Feb 2025 13:40:44 +0000 (14:40 +0100)] 
Make CRYPTO_atomic_load/store use the same preprocessor guards

as the other CRYPTO_atomic_X functions.
All CRYPTO_atomic functions should use the same logic here,
just in case...

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26815)

5 months agoCleanup atomic fallbacks in threads_pthread.c
Bernd Edlinger [Tue, 18 Feb 2025 11:37:42 +0000 (12:37 +0100)] 
Cleanup atomic fallbacks in threads_pthread.c

the unused atomic stub functions make clang issue
unused function warnings -Wunused-function

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26815)

5 months agoEnhance thread sanitizer CI tests
Bernd Edlinger [Tue, 18 Feb 2025 11:05:07 +0000 (12:05 +0100)] 
Enhance thread sanitizer CI tests

Related to issue #26798

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26815)

5 months agocross-compiles.yml: Disable FIPS for cross compiles
Tomas Mraz [Wed, 19 Feb 2025 14:03:35 +0000 (15:03 +0100)] 
cross-compiles.yml: Disable FIPS for cross compiles

When running tests things are too slow due to SLH-DSA POST.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26820)

5 months agorun-checker-daily.yml: Add memory sanitizer run with SLH-DSA enabled
Tomas Mraz [Wed, 19 Feb 2025 13:57:12 +0000 (14:57 +0100)] 
run-checker-daily.yml: Add memory sanitizer run with SLH-DSA enabled

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26820)

5 months agomake-test: No verbose tar output
Tomas Mraz [Wed, 19 Feb 2025 13:56:19 +0000 (14:56 +0100)] 
make-test: No verbose tar output

This just clutters the logs otherwise.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26820)

5 months agorun-checker-daily.yml: Adjust the list of jobs
Tomas Mraz [Wed, 19 Feb 2025 13:49:43 +0000 (14:49 +0100)] 
run-checker-daily.yml: Adjust the list of jobs

Some of the disablables are already disabled by default.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26820)

5 months agoDisable SLH-DSA in memory sanitizer
Tomas Mraz [Tue, 18 Feb 2025 17:13:22 +0000 (18:13 +0100)] 
Disable SLH-DSA in memory sanitizer

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26820)

5 months agoAdded new API to enable 0-RTT for 3rd party QUIC stacks.
Cheng Zhang [Thu, 20 Feb 2025 02:28:35 +0000 (10:28 +0800)] 
Added new API to enable 0-RTT for 3rd party QUIC stacks.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26842)

5 months agoUse OPENSSL_strdup instead of strdup
Andrew Dinh [Thu, 20 Feb 2025 06:59:07 +0000 (13:59 +0700)] 
Use OPENSSL_strdup instead of strdup

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643038

Also NULL check for the allocation.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26843)

5 months agofips: change SLH-DSA key generation to use a fast algorithm flavour
Pauli [Wed, 19 Feb 2025 23:34:36 +0000 (10:34 +1100)] 
fips: change SLH-DSA key generation to use a fast algorithm flavour

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26837)

5 months agoslh-dsa: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:55 +0000 (10:48 +1100)] 
slh-dsa: avoid pairwise test when doing key generation CAST

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26838)

5 months agoml-kem: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:37 +0000 (10:48 +1100)] 
ml-kem: avoid pairwise test when doing key generation CAST

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26838)

5 months agoml-dsa: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:25 +0000 (10:48 +1100)] 
ml-dsa: avoid pairwise test when doing key generation CAST

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26838)

5 months agofips: add function to detect if the self tests are running
Pauli [Wed, 19 Feb 2025 23:41:56 +0000 (10:41 +1100)] 
fips: add function to detect if the self tests are running

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26838)

5 months agoSLH-DSA coverity fixes.
slontis [Wed, 19 Feb 2025 20:54:54 +0000 (07:54 +1100)] 
SLH-DSA coverity fixes.

Fixes 1643092 and 1643093

Neither of these are major issues, but fixed anyway..

i.e. 1<<hm is bounded by the parameter set so this is not an issue
Not checking an error from WPACKET_memcpy() would also not cause an
issue.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26835)

5 months agoRefactor EVP_SKEY initialization
Tomas Mraz [Mon, 17 Feb 2025 11:06:30 +0000 (12:06 +0100)] 
Refactor EVP_SKEY initialization

Enforce that skeymgmt cannot ever be NULL in EVP_SKEY.

Also add missing allocation checks.

Fixes multiple issues found by Coverity.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26795)

5 months agoMake org.openssl.winstore: work in openssl-ts
Shakti Shah [Wed, 19 Feb 2025 16:08:36 +0000 (21:38 +0530)] 
Make org.openssl.winstore: work in openssl-ts

Fixes #26739

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26833)

5 months agoSet op_num to 0
Andrew Dinh [Wed, 19 Feb 2025 11:24:47 +0000 (18:24 +0700)] 
Set op_num to 0

Here, op_num is just used for logging purposes (number of completed operations), so start it at 0

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643034

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26829)

5 months agoFix coverity finding
Dmitry Belyavskiy [Wed, 19 Feb 2025 14:27:57 +0000 (15:27 +0100)] 
Fix coverity finding

Coverity ID: 1643094

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26831)

5 months agossl_lib.c: Check for NULL from SSL_CONNECTION_FROM_SSL()
Andrew Dinh [Wed, 19 Feb 2025 06:41:03 +0000 (13:41 +0700)] 
ssl_lib.c: Check for NULL from SSL_CONNECTION_FROM_SSL()

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643027
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643028

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26824)

5 months agoEC_get_buildin_curves does not return an error, this check is unnecessary.
otherddn1978 [Wed, 12 Feb 2025 10:54:46 +0000 (13:54 +0300)] 
EC_get_buildin_curves does not return an error, this check is unnecessary.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

unused code has been removed

delete whitespace

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26719)

5 months agoNULL checks for QUIC code
Andrew Dinh [Wed, 19 Feb 2025 06:49:06 +0000 (13:49 +0700)] 
NULL checks for QUIC code

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643033
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643032
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643031
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643030
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643029

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26825)

5 months agoCI: ssl-trace is enabled by default
Tomas Mraz [Tue, 18 Feb 2025 07:44:40 +0000 (08:44 +0100)] 
CI: ssl-trace is enabled by default

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26810)

5 months agotest/quicapitest.c: Fix build with no-ssl-trace
Tomas Mraz [Tue, 18 Feb 2025 07:42:12 +0000 (08:42 +0100)] 
test/quicapitest.c: Fix build with no-ssl-trace

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26810)

5 months agofix: add check for NULL zalloc in tls-provider.c (reverse if statement)
Burkov Egor [Tue, 18 Feb 2025 09:49:07 +0000 (12:49 +0300)] 
fix: add check for NULL zalloc in tls-provider.c (reverse if statement)

CLA: trivial

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26814)

5 months agoConfigurable import-time PCT for ML-KEM
Viktor Dukhovni [Fri, 14 Feb 2025 17:36:25 +0000 (04:36 +1100)] 
Configurable import-time PCT for ML-KEM

And related cleanup.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26789)

5 months agoslh-dsa: use fast flavours for FIPS Power Up Self Test
Pauli [Wed, 19 Feb 2025 03:51:18 +0000 (14:51 +1100)] 
slh-dsa: use fast flavours for FIPS Power Up Self Test

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26821)

5 months agotestutil: remove unused buffer from stanza structure
Pauli [Mon, 17 Feb 2025 08:42:46 +0000 (19:42 +1100)] 
testutil: remove unused buffer from stanza structure

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslh-dsa: update changes authorship
Pauli [Mon, 17 Feb 2025 03:56:11 +0000 (14:56 +1100)] 
slh-dsa: update changes authorship

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslh-dsa: add key generation tests
Pauli [Sun, 16 Feb 2025 23:46:34 +0000 (10:46 +1100)] 
slh-dsa: add key generation tests

These are reasonably fast so are not flagged as extended tests.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslhdsa: add Python script to convert NIST ACVP data to evp_test format
Pauli [Sun, 16 Feb 2025 23:46:12 +0000 (10:46 +1100)] 
slhdsa: add Python script to convert NIST ACVP data to evp_test format

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslh-dsa: change the seed parameter name from entropy to seed
Pauli [Sun, 16 Feb 2025 22:53:10 +0000 (09:53 +1100)] 
slh-dsa: change the seed parameter name from entropy to seed

This brings it inline with the same parameter for ML-KEM and ML-DSA.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoevp_test: include signature generation and verification tests for SLH-DSA
Pauli [Fri, 14 Feb 2025 02:47:05 +0000 (13:47 +1100)] 
evp_test: include signature generation and verification tests for SLH-DSA

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslh-dsa: add signature generation tests
Pauli [Fri, 14 Feb 2025 01:55:21 +0000 (12:55 +1100)] 
slh-dsa: add signature generation tests

This marks the first use of the extended test feature in evp_test.
The reason behind this is the amount of time the full SLH-DSA tests consume.
The non-extended tests chosen so that they exercise all of the algorithms
at least once and all the varying combinations of features for the fast
algorithms.

On my build machine the full test suite takes: 290 seconds.
With the reduction to a dozen tests it takes: 10.5 seconds.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoslh-dsa: add signature verification failure tests
Pauli [Fri, 14 Feb 2025 02:13:44 +0000 (13:13 +1100)] 
slh-dsa: add signature verification failure tests

These are fast and don't require reduction in number.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoevp_test: add a Verify-Message-Public test type
Pauli [Fri, 14 Feb 2025 01:54:59 +0000 (12:54 +1100)] 
evp_test: add a Verify-Message-Public test type

This is like Verify-Message but accepts a public key instead of a private one.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agotestutil: increase the line length for reading stanzas
Pauli [Fri, 14 Feb 2025 02:00:59 +0000 (13:00 +1100)] 
testutil: increase the line length for reading stanzas

PQC algorithms and SLH-DSA in particular have very long lines of data.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agocoverage: enable extended EVP tests
Pauli [Thu, 13 Feb 2025 22:45:28 +0000 (09:45 +1100)] 
coverage: enable extended EVP tests

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoevp_test: add concept of extended tests to evp_test
Pauli [Thu, 13 Feb 2025 22:43:54 +0000 (09:43 +1100)] 
evp_test: add concept of extended tests to evp_test

These tests are not run by default, instead they run when the EVP_TEST_EXTENDED environment variable
has an integer value other than zero.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

5 months agoMore consistent ML-KEM key checks
Viktor Dukhovni [Tue, 18 Feb 2025 07:42:41 +0000 (18:42 +1100)] 
More consistent ML-KEM key checks

- Cross-check seed `z` value on import as well as load.
- In import/load When re-generating from a seed, check hash of any
  explicit private key when both provided.
- Avoid leak of expanded key encoding when load fails.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26812)

5 months agoTypo fix
Viktor Dukhovni [Tue, 18 Feb 2025 09:41:13 +0000 (20:41 +1100)] 
Typo fix

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26813)

5 months agoMerge quic client and quic server interop CI
Neil Horman [Mon, 17 Feb 2025 18:59:53 +0000 (13:59 -0500)] 
Merge quic client and quic server interop CI

Now that quic server is merged, we can merge the CI jobs that test the
client and server interop tests

Fixes openssl/project#1105

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26804)

5 months agoAdd the SSL_NO_EOED macro test
Cheng Zhang [Thu, 13 Feb 2025 03:01:34 +0000 (11:01 +0800)] 
Add the SSL_NO_EOED macro test

test_no_end_of_early_data

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26552)

5 months agoAdd the SSL_NO_EOED internal macro
Cheng Zhang [Tue, 11 Feb 2025 08:13:26 +0000 (16:13 +0800)] 
Add the SSL_NO_EOED internal macro

The TLS EndOfEarlyData message is not applicable in some scenarios (e.g., QUIC).
This adds a macro to handle this message.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26552)

5 months agossl3_ctrl(): Fix condition in SSL_CTRL_GET_PEER_SIGNATURE_NAME
Viktor Dukhovni [Tue, 18 Feb 2025 14:44:17 +0000 (01:44 +1100)] 
ssl3_ctrl(): Fix condition in SSL_CTRL_GET_PEER_SIGNATURE_NAME

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26819)

5 months agoRelax checking of supported-groups/keyshare ordering
Neil Horman [Tue, 18 Feb 2025 14:01:40 +0000 (09:01 -0500)] 
Relax checking of supported-groups/keyshare ordering

quic interop testing showed that interop with the mvfst client was
failing, due to detecting mis ordering of supported groups and keyshare
extensions

This is strictly a mvfst problem to fix, but RFC 8446 indicates that we
MAY check the ordering but don't strictly have to.

We've opened an issue with the client to fix this, but in the interests
of client compatibility relax the ordering check so that, instead of
issuing a fatal alert, we just log a trace message indicating the
discrepancy

Fixes openssl/project#1106

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26818)

5 months agoFix memory leak in ecdsa_keygen_knownanswer_test
Neil Horman [Mon, 17 Feb 2025 14:24:26 +0000 (09:24 -0500)] 
Fix memory leak in ecdsa_keygen_knownanswer_test

We allocate an EC_POINT with EC_POINT_new here, but in failing a
subsequent check, we don't free it, correct that.

Fixes #26779

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26799)

5 months agoML-KEM Add ACVP tests using latest values from
slontis [Mon, 17 Feb 2025 23:54:35 +0000 (10:54 +1100)] 
ML-KEM Add ACVP tests using latest values from

https://github.com/usnistgov/ACVP-Server/blob/master/gen-val/json-files/
Which are parsed using mlkem_parse.py

The existing BoringSSL related .txt files have been left in place.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26791)

5 months ago ML-KEM: Modify existing ML-KEM keygen tests to not use custom data.
slontis [Mon, 17 Feb 2025 23:51:48 +0000 (10:51 +1100)] 
 ML-KEM: Modify existing ML-KEM keygen tests to not use custom data.

There are general input and output controls that are used instead.
Also fix a memory leak in keygen.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26791)

5 months agossl_test: correctly handle ML-DSA being disabled
Pauli [Tue, 18 Feb 2025 01:45:58 +0000 (12:45 +1100)] 
ssl_test: correctly handle ML-DSA being disabled

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26806)

5 months agomldsa: add run-checker workflow for no-ml-dsa option
Pauli [Mon, 17 Feb 2025 23:04:58 +0000 (10:04 +1100)] 
mldsa: add run-checker workflow for no-ml-dsa option

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26806)

5 months agoml-kem: add ML-KEM to bulk disable cascade
Pauli [Mon, 17 Feb 2025 23:08:11 +0000 (10:08 +1100)] 
ml-kem: add ML-KEM to bulk disable cascade

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26807)

5 months agoml-dsa: test ML-DSA under FIPS
Pauli [Mon, 17 Feb 2025 23:02:10 +0000 (10:02 +1100)] 
ml-dsa: test ML-DSA under FIPS

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26805)

5 months agoFix coverity issues
Dmitry Belyavskiy [Mon, 17 Feb 2025 10:16:34 +0000 (11:16 +0100)] 
Fix coverity issues

Fixes coverity issues 16429641642965164296616429681642969

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26793)

5 months agoFree hashtable prior to freeing atomic worker_lock
Neil Horman [Mon, 17 Feb 2025 15:13:32 +0000 (10:13 -0500)] 
Free hashtable prior to freeing atomic worker_lock

lhash_test uses a hashtable that may not be empty at the end of the test

Given that the free function frees the elements in the list and uses the
atomic worker_lock to do so, we need to free the hash table prior to
freeing the working lock to avoid the use of unallocated memory.

Fixes #26798

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26800)

5 months agoAdds missing checks of return from XXX_up_ref(). feature/evp_skey
Frederik Wedel-Heinen [Sat, 28 Dec 2024 09:13:48 +0000 (10:13 +0100)] 
Adds missing checks of return from XXX_up_ref().

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26294)

5 months agoDo not call BIO_printf() from FIPS_MODULE
Tomas Mraz [Thu, 13 Feb 2025 20:00:03 +0000 (21:00 +0100)] 
Do not call BIO_printf() from FIPS_MODULE

Fixes #26743

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26744)

5 months agoOSSL_CMP_MSG_http_perform(): support using BIO from OSSL_CMP_CTX_set_transfer_cb_arg()
Dr. David von Oheimb [Tue, 4 Feb 2025 13:12:23 +0000 (14:12 +0100)] 
OSSL_CMP_MSG_http_perform(): support using BIO from OSSL_CMP_CTX_set_transfer_cb_arg()

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26628)

5 months agoInitial slh-dsa fuzzer 26788/head
Neil Horman [Fri, 7 Feb 2025 19:37:57 +0000 (14:37 -0500)] 
Initial slh-dsa fuzzer

Current preforms the following operations

1) Generates arbitrary key pairs
2) Generates key pairs with parameters (both correct and incorrect)
   based on fuzzer input buffer
3) Exports and re-imports keys, confirming validity
4) Preforms Sign and Verify operations with optional parameters based on
   fuzzer input buffer

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26708)

5 months agoSLH-DSA: Add EVP_PKEY_CTX_dup() support.
slontis [Tue, 11 Feb 2025 04:30:59 +0000 (15:30 +1100)] 
SLH-DSA: Add EVP_PKEY_CTX_dup() support.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26701)

5 months agoSLH_DSA: Make apps.c do_X509_REQ_verify() call work correctly.
slontis [Tue, 4 Feb 2025 06:39:34 +0000 (17:39 +1100)] 
SLH_DSA: Make apps.c do_X509_REQ_verify() call work correctly.

- Added sigid_algs for SLH_DSA such that OBJ_find_sigid_algs() works.
- OBJ_sn2nid() was also being called, so the SN form of SLH_DSA
  algorithms needed to be added to the provider dispatch tables.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26625)

5 months agoSLH_DSA: Add support for generating X509 certs via the openssl
slontis [Tue, 4 Feb 2025 03:35:38 +0000 (14:35 +1100)] 
SLH_DSA: Add support for generating X509 certs via the openssl
command line app.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26625)

5 months agoSLH-DSA cleanups
slontis [Tue, 28 Jan 2025 03:14:53 +0000 (14:14 +1100)] 
SLH-DSA cleanups

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoSLH-DSA More fixups
slontis [Thu, 23 Jan 2025 03:51:42 +0000 (14:51 +1100)] 
SLH-DSA More fixups

Also added slh_dsa_key_dup()

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoSLH-DSA: Remove legacy ASN1 method tables for SLH-DSA. Update to use
slontis [Wed, 22 Jan 2025 23:26:51 +0000 (10:26 +1100)] 
SLH-DSA: Remove legacy ASN1 method tables for SLH-DSA. Update to use
custom encoders for SLH_DSA decode_der2key.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoSLH-DSA cleanups
slontis [Wed, 22 Jan 2025 21:20:58 +0000 (08:20 +1100)] 
SLH-DSA cleanups

Addressed some review comments.
- Ref counting has been removed from SLH_DSA_KEY (EVP_PKEY is responsible
for the keys ref counting).
- Moved constants and prefetched objects into SLH_DSA_KEY.
- The SLH_DSA_HASH_CTX is still required since there are multiple
  contexts that need to propagate to a lot of functions, but it no
  longer contains the constants. Note that it also holds a pointer to
  the SLH_DSA_KEY.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH_DSA key validation.
slontis [Thu, 21 Nov 2024 05:09:18 +0000 (16:09 +1100)] 
Add SLH_DSA key validation.

The pairwise test requires that the computed PK_ROOT key matches the
keys PK_ROOT value. The public and private key tests just require the
key elements to exist.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA FIPS self tests
slontis [Thu, 21 Nov 2024 01:15:24 +0000 (12:15 +1100)] 
Add SLH-DSA FIPS self tests

This requires a keygen test, as well as Sign/Verify tests for at least 1
sha2 algorithm and 1 shake related algorithm.

A pairwise consistency test has also been added to the key generation.

Note that self test datat for the signature is currently stored as a
sha256 digest in order to reduce the memory footprint.
(Since the signature size for sha2/shake using 128s = ~8K, and for 128f = ~17K)

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAdd SLH-DSA encoder/decoder support.
slontis [Tue, 19 Nov 2024 04:40:13 +0000 (15:40 +1100)] 
Add SLH-DSA encoder/decoder support.

This required adding additional EVP_PKEY_ASN1_METHOD methods.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)

5 months agoAddress style check nits for SLH-DSA
slontis [Tue, 12 Nov 2024 23:59:10 +0000 (10:59 +1100)] 
Address style check nits for SLH-DSA

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25882)