Commit Graph

1408 Commits

Author SHA1 Message Date
openssl-machine e66332418f Copyright year updates
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes
2025-09-02 13:05:45 +00:00
Simo Sorce 55b2bf1abc Implement EVP_KDF_CTX_set_SKEY
This allows to use a SKEY as input to a KDF derive operation.

Signed-off-by: Simo Sorce <simo@redhat.com>

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)
2025-08-30 21:11:06 -04:00
Dmitry Belyavskiy 7d42becc0d Implement EVP_PKEY_derive_SKEY
Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com>
Signed-off-by: Simo Sorce <simo@redhat.com>

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)
2025-08-30 21:11:06 -04:00
Dmitry Belyavskiy 8c3c2f5cd8 Add GENERIC SKEYMGMT to the legacy provider
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)
2025-08-30 21:11:06 -04:00
Pauli eaba675c4b ml-kem: convert to transient error state on import failure in FIPS provider
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)
2025-08-30 09:11:13 -04:00
Pauli 56a791209c ml-dsa: convert to transient error state on import failure in FIPS provider
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)
2025-08-30 09:11:13 -04:00
Pauli 811f68ffe2 ecx: convert to transient error state on import failure in FIPS provider
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)
2025-08-30 09:10:59 -04:00
Pauli d6f398cc95 ec: convert to transient error state on import failure in FIPS provider
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)
2025-08-30 09:10:59 -04:00
Pauli c2ebeeeff6 dh: convert to transient error state on import failure in FIPS provider
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)
2025-08-30 09:10:59 -04:00
Pauli 7903702280 slh-dsa: add a PCT for key import when in FIPS mode
Fixes #28182

Co-Authored-By: slontis <shane.lontis@oracle.com>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28276)
2025-08-29 14:16:17 -04:00
Anthony Roberts c66d9760a7 Fix `VC-WIN64-CLANGASM-ARM` target
This was broken for Windows ARM64 in #22949

The comments were in the wrong format, and a define check of `_M_ARM64` was missed in places

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27958)
2025-08-26 12:05:28 +02:00
Nikola Pajkovsky b561837ee9 dh: add FIPS 140-3 PCT on key generation
According to FIPS 140-3 IG 10.3.A Additonal Comment 1, a PCT shall be
performed.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28280)
2025-08-22 15:03:01 -04:00
Pauli 3f5561a9f4 keymgmt: update template
The template file is exhibiting some bitrot:
1. convert to using generated param name decoders
2. add the missing `template_imexport_types` function.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28275)
2025-08-22 15:33:20 +10:00
Pauli accc7ce60e ecx: convert to using generated parameter decoding
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28275)
2025-08-22 15:33:20 +10:00
Pauli 326c36c418 lms: convert to using generated parameter decoding
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28275)
2025-08-22 15:33:03 +10:00
Pauli 4728227992 slh-dsa: convert to using a generated decoder
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28275)
2025-08-22 15:33:03 +10:00
Pauli ef77afe58b key management: rename key management files in anticipations of generated decoding
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28275)
2025-08-22 15:33:03 +10:00
Niels Dossche 3e2f54a718 Make error checks on RSA_public_decrypt() consistent
Some are only checking for a value < 0, some for <= 0, some for == 0, etc.
The documentation tells us that -1 is returned on error, so at least the
== 0 ones are wrong. In general, the return values are checked
inconsistently. This patch makes the return value checks consistent to
the form that seems to occur most.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28306)
2025-08-21 20:04:40 +02:00
Dimitri John Ledkov c281a7303c fips: implement deterministic ECDSA
[FIPS 186-5](https://doi.org/10.6028/NIST.FIPS.186-5) approved
deterministic ECDSA in the same manner as [RFC
6979](https://datatracker.ietf.org/doc/html/rfc6979).

Thus add deterministic ECDSA capability to the FIPS provider.

DSA signature generation has been deprecated and removed from FIPS
186-5, thus deterministic DSA signature creation is not added to the
FIPS provider.

Testing can be done by performing 20-test_dgst.t but need to version
guarded against different FIPS provider versions. Thus is left out of
this PR for now.

It is not clear if HMAC-DRBG-KDF should be exposed publically for
direct usage as an approved usage, or if it should be marked as
unapproved or better yet made completely internal to the FIPS
provider.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28213)
2025-08-21 09:58:55 +10:00
Pauli 18f822f6a6 rsa: made the padding and salt length parameter decoding more straightforward
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28242)
2025-08-15 11:13:19 +10:00
Pauli c33bce6440 hkdf: make the mode decoding more straightforward
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28242)
2025-08-15 11:13:19 +10:00
Pauli e676a87a27 asym cipher: make the pad type decoding more straightforward
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28242)
2025-08-15 11:13:19 +10:00
Pauli 1aae0a4016 rsa sig: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli ecc3491d53 ecdsa sig: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli a9d7e696ec dsa sig: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli fc7a72db24 hmac drbg: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 4e1eaa17c7 hash drbg: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 226b5a5ea4 ctr drbg: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 2f205fc496 crng test: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli b830ebaf62 test_rng: make indicator parameter conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 40dd58e016 kmac: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 60f8ff1511 hmac: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 2d1280e5ee cmac: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:12 +10:00
Pauli 3473f699fd rsa kem: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:11 +10:00
Pauli b27f840351 ecx: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:11 +10:00
Pauli f9bf224ef9 ecdh: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:11 +10:00
Pauli d01910a4f9 dh: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:11 +10:00
Pauli b411ef0b53 rsa: make parameters conditional on FIPS
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28243)
2025-08-15 11:03:11 +10:00
Pauli f4de265c0f encode_key2ms: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 6696830609 encode_key2any: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 3b69c40a27 decode_spki2typespki: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli f9a5796357 decode_pvk2key: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 70e33aef6e decode_pem2der: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 324fc17017 decode_epki2pki: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 360388e55d decode_der2key: convert to use generated parameter parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:58 +10:00
Pauli 33651beaf7 encode_decode: rename files for generated param parsing
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28152)
2025-08-13 12:10:24 +10:00
Pauli a14e2f417e rsa: update to use generated param decoders for signature operations
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28150)
2025-08-13 12:07:50 +10:00
Pauli 79197465e3 sm2: update to use generated param decoders for signature operations
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28150)
2025-08-13 12:07:50 +10:00
Pauli 74ccf8ce97 slh_dsa: update to use generated param decoders for signature operations
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28150)
2025-08-13 12:07:50 +10:00
Pauli 3c9ad1dba9 ecdsa: update to use generated param decoders for signature operations
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28150)
2025-08-13 12:07:50 +10:00