]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
11 months agoFIPS: Add EDDSA public key validation.
slontis [Thu, 22 Aug 2024 01:50:17 +0000 (11:50 +1000)] 
FIPS: Add EDDSA public key validation.

EVP_PKEY_public_check() can be used by ED25519 and ED448 in order to
determine if the public key is a valid point on the curve.

The FIPS ACVP tests require public key validation tests.
See https://github.com/usnistgov/ACVP-Server/blob/master/gen-val/json-files/EDDSA-KeyVer-1.0/internalProjection.json

Note that this is NOT required to be called before EDDSA signature verification
since it is done internally.

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

11 months agoUpdate FIPS 140-3 self tests
slontis [Mon, 19 Aug 2024 02:01:53 +0000 (12:01 +1000)] 
Update FIPS 140-3 self tests

Cleanup + remove a few tests that are not required.

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

11 months agoFIPS: Change fips tests to use SHA2 for corruption test.
slontis [Wed, 21 Aug 2024 23:09:14 +0000 (09:09 +1000)] 
FIPS: Change fips tests to use SHA2 for corruption test.

Fixes cross testing with OpenSSL 3.4 with removed SHA1 from the self
tests.

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

11 months agos390x: Fix memory leak in s390x_HMAC_CTX_copy()
Ingo Franzki [Tue, 20 Aug 2024 09:35:20 +0000 (11:35 +0200)] 
s390x: Fix memory leak in s390x_HMAC_CTX_copy()

When s390x_HMAC_CTX_copy() is called, but the destination context already
has a buffer allocated, it is not freed before duplicating the buffer from
the source context.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25238)

11 months agoacvptest: add positive and negative tests for verify message param
Pauli [Mon, 19 Aug 2024 01:34:12 +0000 (11:34 +1000)] 
acvptest: add positive and negative tests for verify message param

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

11 months agorsa: add verify_message param support
Pauli [Mon, 19 Aug 2024 00:40:24 +0000 (10:40 +1000)] 
rsa: add verify_message param support

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

11 months agoecdsa: add verify_message param support
Pauli [Mon, 19 Aug 2024 00:40:14 +0000 (10:40 +1000)] 
ecdsa: add verify_message param support

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

11 months agoparam: add OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE parameter name
Pauli [Fri, 16 Aug 2024 00:24:05 +0000 (10:24 +1000)] 
param: add OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE parameter name

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

11 months agodoc: document the OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE parameter
Pauli [Fri, 16 Aug 2024 00:21:12 +0000 (10:21 +1000)] 
doc: document the OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE parameter

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

11 months agofuzz/hashtable.c: rc == -1 on insert is OK when fuzzing
Tomas Mraz [Thu, 22 Aug 2024 12:49:05 +0000 (14:49 +0200)] 
fuzz/hashtable.c: rc == -1 on insert is OK when fuzzing

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25273)

11 months agoossl_ht_insert(): Allow for 4 iterations of grow_hashtable()
Tomas Mraz [Thu, 22 Aug 2024 12:44:02 +0000 (14:44 +0200)] 
ossl_ht_insert(): Allow for 4 iterations of grow_hashtable()

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25273)

11 months agoReplace PKCS#1 v1.5 padding in RSA PCT
Joachim Vandersmissen [Fri, 15 Mar 2024 16:34:12 +0000 (11:34 -0500)] 
Replace PKCS#1 v1.5 padding in RSA PCT

After December 31, 2023, SP 800-131Ar2 [0] no longer allows PKCS#1 v1.5
padding for RSA "key-transport" (aka encryption and decryption).
There's a few good options to replace this usage in the RSA PCT, but
the simplest is verifying m = (m^e)^d mod n, (where 1 < m < (n − 1)).
This is specified in SP 800-56Br2 (Section 6.4.1.1) [1] and allowed by
FIPS 140-3 IG 10.3.A. In OpenSSL, this corresponds to RSA_NO_PADDING.

[0]: https://doi.org/10.6028/NIST.SP.800-131Ar2
[1]: https://doi.org/10.6028/NIST.SP.800-56Br2

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

11 months agoReplace PKCS#1 v1.5 encryption in RSA PCT
Joachim Vandersmissen [Thu, 14 Mar 2024 00:26:21 +0000 (19:26 -0500)] 
Replace PKCS#1 v1.5 encryption in RSA PCT

After December 31, 2023, SP 800-131Ar2 [0] no longer allows PKCS#1 v1.5
padding for RSA "key-transport" (aka encryption and decryption).
There's a few good options to replace this usage in the RSA PCT, but
signature generation and verification using PKCS#1 v1.5 padding (which
remains approved) is the simplest.

[0]: https://doi.org/10.6028/NIST.SP.800-131Ar2

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

11 months agoFix error handling in OBJ_add_object
Bernd Edlinger [Fri, 27 Oct 2023 10:05:05 +0000 (12:05 +0200)] 
Fix error handling in OBJ_add_object

This fixes the possible memory leak in OBJ_add_object
when a pre-existing object is replaced by a new one,
with identical NID, OID, and/or short/long name.
We do not try to delete any orphans, but only mark
them as type == -1, because the previously returned
pointers from OBJ_nid2obj/OBJ_nid2sn/OBJ_nid2ln
may be cached by applications and can thus not
be cleaned up before the application terminates.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22534)

11 months agox_attrib: fix a memory leak
Beat Bolli [Thu, 15 Aug 2024 10:35:02 +0000 (12:35 +0200)] 
x_attrib: fix a memory leak

The X509_NAME object needs to be free'd even if printing it fails.

Introduced in be5adfd6e3 ("Support subjectDirectoryAttributes and
associatedInformation exts", 2024-06-18), but subsequently moved in
7bcfb41489 ("ossl_print_attribute_value(): use a sequence value only if
type is a sequence", 2024-08-05).

Signed-off-by: Beat Bolli <dev@drbeat.li>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25207)

11 months agoAdd Changes entry for debuginfo generation
Neil Horman [Thu, 15 Aug 2024 12:29:34 +0000 (08:29 -0400)] 
Add Changes entry for debuginfo generation

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

11 months agoAdd a test for debuginfo generation
Neil Horman [Wed, 14 Aug 2024 15:18:04 +0000 (11:18 -0400)] 
Add a test for debuginfo generation

Add a check to ensure debug info generation works.

We piggyback on a test that already builds DWARF symbols (--debug)
The test
1) makes the debuginfo files
2) runs gdb, loading the libcrypto.so.3 file
3) Check to make sure that the output of gdb indicates that it loads the
   .debug file base on the reference in the loaded file

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

11 months agoAdd debuginfo build target
Neil Horman [Tue, 13 Aug 2024 19:16:08 +0000 (15:16 -0400)] 
Add debuginfo build target

In the webinar we are currently producing on debugging openssl
applications, we talk about ways to allow debugable binaries without
having to ship all the debug DWARF information to production systems.

Add an optional target to do that DWARF separation to aid users

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

11 months agotest/provider_test.c: Add OSSL_PROVIDER_unload() to avoid memory leak
Jiasheng Jiang [Tue, 6 Aug 2024 19:18:34 +0000 (19:18 +0000)] 
test/provider_test.c: Add OSSL_PROVIDER_unload() to avoid memory leak

Add OSSL_PROVIDER_unload() when OSSL_PROVIDER_add_builtin() fails to avoid memory leak.

Fixes: 5442611dff ("Add a test for OSSL_LIB_CTX_new_child()")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25109)

11 months agotest/provider_fallback_test.c: Add OSSL_PROVIDER_unload() to avoid memory leak
Jiasheng Jiang [Tue, 6 Aug 2024 18:42:06 +0000 (18:42 +0000)] 
test/provider_fallback_test.c: Add OSSL_PROVIDER_unload() to avoid memory leak

Add OSSL_PROVIDER_unload() when test_provider() fails to avoid memory leak.

Fixes: f995e5bdcd ("TEST: Add provider_fallback_test, to test aspects of
fallback providers")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25108)

11 months agoFix the alert used on a missing key_share
Matt Caswell [Wed, 31 Jul 2024 14:25:48 +0000 (15:25 +0100)] 
Fix the alert used on a missing key_share

RFC8446 requires we send an illegal_parameter alert if we don't get a
key_share back from the server and our kex_modes require one. We were
instead reporting this as missing_extension.

Fixes #25040

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

11 months agoAdd additional test cases for Single Step KDF.
slontis [Wed, 7 Aug 2024 00:58:10 +0000 (10:58 +1000)] 
Add additional test cases for Single Step KDF.

SSKDF KMAC tests added.
Added FIPS indicator tests for SSKDF Hash, HMAC, and KMAC cases.
Added short salt length tests for SSKDF HMAC and KMAC.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25049)

11 months agoAdd FIPS KMAC key check
slontis [Mon, 5 Aug 2024 05:25:35 +0000 (15:25 +1000)] 
Add FIPS KMAC key check

This adds a FIPS indicator for KMAC key size.
Note that 112 bits keys are still smaller than the
sizes required to reach 128 bits for KMAC128 and
256 bits for KMAC256

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25049)

11 months agoAdd HMAC FIPS keysize check.
slontis [Wed, 31 Jul 2024 04:56:44 +0000 (14:56 +1000)] 
Add HMAC FIPS keysize check.

HMAC has been changed to use a FIPS indicator for its key check.

HKDF and Single Step use a salt rather than a key when using HMAC,
so we need a mechanism to bypass this check in HMAC.

A seperate 'internal' query table has been added to the FIPS provider
for MACS. Giving HMAC a seprate dispatch table allows KDF's to ignore
the key check. If a KDF requires the key check then it must do the
check itself. The normal MAC dipatch table is used if the user fetches
HMAC directly.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25049)

11 months agohashtable.c: Code style fixes
Tomas Mraz [Fri, 16 Aug 2024 14:27:17 +0000 (16:27 +0200)] 
hashtable.c: Code style fixes

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

11 months agocore_namemap.c: 2048 hashtable buckets should be sufficient
Tomas Mraz [Fri, 16 Aug 2024 13:54:15 +0000 (15:54 +0200)] 
core_namemap.c: 2048 hashtable buckets should be sufficient

It is unlikely we would need more than 4000 names and even
with more names (up to 8192) it would still work, just
the performance fo the namemap would degrade.

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

11 months agoFor lockless reads use the whole hashtable for colliding entries
Tomas Mraz [Fri, 16 Aug 2024 13:40:43 +0000 (15:40 +0200)] 
For lockless reads use the whole hashtable for colliding entries

Instead of just using the neighborhood, fill
subsequent neighborhoods with colliding entries.

If the hashtable is properly sized, it won't degrade
performance too much.

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

11 months agoUse the new hashtable for core_namemap
Tomas Mraz [Mon, 27 May 2024 14:50:05 +0000 (16:50 +0200)] 
Use the new hashtable for core_namemap

This replaces LHASH in core_namemap with the new hashtable and adds
a reverse mapping in form of stack of stacks instead of iterating
the existing hash table members.

The new hashtable is used in lockless-read mode.

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

11 months agohashtable: Support lockless reads
Tomas Mraz [Mon, 27 May 2024 14:49:15 +0000 (16:49 +0200)] 
hashtable: Support lockless reads

Also build it in the FIPS provider too and properly
report error on insert when hashtable cannot be grown.

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

11 months agohashtable.c: Avoid infinite loop in ossl_ht_insert()
Tomas Mraz [Fri, 17 May 2024 11:41:09 +0000 (13:41 +0200)] 
hashtable.c: Avoid infinite loop in ossl_ht_insert()

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

11 months agosome performance improvements
Neil Horman [Wed, 15 May 2024 19:34:15 +0000 (15:34 -0400)] 
some performance improvements

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

11 months agoalternate collision checking support
Neil Horman [Wed, 15 May 2024 13:20:30 +0000 (09:20 -0400)] 
alternate collision checking support

Add full key matching to hashtable

the idea is that on a hash value match we do a full memory comparison of
the unhashed key to validate that its actually the key we're looking for

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

11 months agofix: Have util/mkerr.pl comply better with our coding style
Richard Levitte [Tue, 16 Jul 2024 04:52:07 +0000 (06:52 +0200)] 
fix: Have util/mkerr.pl comply better with our coding style

util/mkerr.pl produced lines like these:

    {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
    "operation not supported for this keytype"},

According to our coding style, they should look like this:

    {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
     "operation not supported for this keytype"},

This nit was correctly picked up by util/check-format.pl

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24902)

11 months agoEnable RSA-SM3 in the default provider
Richard Levitte [Mon, 19 Aug 2024 06:38:56 +0000 (08:38 +0200)] 
Enable RSA-SM3 in the default provider

It turns out that we didn't allow the combination RSA + SM3 anywhere.

This is perfectly reasonable in the FIPS module, but less so in the default
provider.  This change enables it in the default provider, and adds a simple
evp_test stanza for the RSA-SM3 signature scheme.

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

11 months agofix coding style
Richard Levitte [Tue, 16 Jul 2024 05:06:05 +0000 (07:06 +0200)] 
fix coding style

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

11 months agoAdd new test types in test/evp_test.c, and a test for RSA sigalgs
Richard Levitte [Wed, 10 Jul 2024 19:26:30 +0000 (21:26 +0200)] 
Add new test types in test/evp_test.c, and a test for RSA sigalgs

With these tests, we get to test:

- EVP_PKEY_sign_init_ex()
- EVP_PKEY_verify_init_ex2()
- EVP_PKEY_verify_recover_init_ex2()
- EVP_PKEY_sign_message_init() and friends
- EVP_PKEY_verify_message_init() and friends

A few test cases for RSA-{hash} are added, in
test/recipes/30-test_evp_data/evppkey_rsa_sigalg.txt

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

11 months agoRefactor OpenSSL 'RSA' EVP_SIGNATURE to also include RSA+hash composites
Richard Levitte [Sat, 6 Jul 2024 14:26:39 +0000 (16:26 +0200)] 
Refactor OpenSSL 'RSA' EVP_SIGNATURE to also include RSA+hash composites

(in the code, "sigalg" is used to refer to these composite algorithms,
which is a nod to libcrypto and libssl, where that term is commonly used
for composite algorithms)

To make this implementation possible, wrappers were added around the hash
function itself, allowing the use of existing hash implementations through
their respective OSSL_DISPATCH tables, but also retaining the dynamic fetch
of hash implementations when the digest_sign / digest_verify functionality
is used.  This wrapper allows implementing the RSA+hash composites through
simple initializer function and a custom OSSL_DISPATCH table for each.

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

11 months agoImplement functionality for direct use of composite signature algorithms
Richard Levitte [Thu, 18 Jan 2024 14:27:34 +0000 (15:27 +0100)] 
Implement functionality for direct use of composite signature algorithms

The following API groups are extended with a new init function, as well
as an update and final function, to allow the use of explicitly fetched
signature implementations for any composite signature algorithm, like
"sha1WithRSAEncryption":

- EVP_PKEY_sign
- EVP_PKEY_verify
- EVP_PKEY_verify_recover

To support this, providers are required to add a few new functions, not
the least one that declares what key types an signature implementation
supports.

While at this, the validity check in evp_signature_from_algorithm() is
also refactored; the SIGNATURE provider functionality is too complex for
counters.  It's better, or at least more readable, to check function
combinations.

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

11 months agoLink to the place where signature options are defined
Hubert Kario [Fri, 26 Jul 2024 14:25:42 +0000 (16:25 +0200)] 
Link to the place where signature options are defined

ca man page: link to section

Signed-off-by: Hubert Kario <hkario@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25011)

11 months agoWhen calling ASN1_item_i2d () check both returned length and allocated pointer
XZ-X [Mon, 22 Jul 2024 18:33:02 +0000 (14:33 -0400)] 
When calling ASN1_item_i2d () check both returned length and allocated pointer

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

11 months agoEnhance s_client Output
erbsland-dev [Wed, 17 Jul 2024 21:21:42 +0000 (23:21 +0200)] 
Enhance s_client Output

Fixes #8123: Clarify cipher and protocol version display
- Added a new line “Protocol:” to display the protocol version separately after the cipher line.

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

11 months agotest: add command line indicator option checking to fipsinstall
Pauli [Thu, 15 Aug 2024 00:58:25 +0000 (10:58 +1000)] 
test: add command line indicator option checking to fipsinstall

Validate that the relevant options are on when -pedantic is specified,
off when it isn't and can be given to enable the setting.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25194)

11 months agoAdd FIPS self test updates
slontis [Fri, 16 Aug 2024 09:10:22 +0000 (19:10 +1000)] 
Add FIPS self test updates

After reviewing the FIPS 140-3 IG self tests requirements the following
were added:

- TDES Decryption (Not sure why this was missing)
- DH changed to use ffdhe2048 instead of P,Q,G params.
- Signature code has been changed to use a msg rather than a digest as input.
(Since some digests dont provide the one shot API, the EVP_DigestSignFinal and
EVP_DigestVerifyFinal needed to be exposed to the FIPS provider). The
code is now shared between ED and the other key types.

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

11 months agotest/hmactest: Add further tests for HMAC with multiple update calls
Ingo Franzki [Fri, 2 Feb 2024 13:55:32 +0000 (14:55 +0100)] 
test/hmactest: Add further tests for HMAC with multiple update calls

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25161)

11 months agos390x: Add hardware acceleration for HMAC
Ingo Franzki [Thu, 1 Feb 2024 14:15:27 +0000 (15:15 +0100)] 
s390x: Add hardware acceleration for HMAC

The CPACF instruction KMAC provides support for accelerating the HMAC
algorithm on newer machines for HMAC with SHA-224, SHA-256, SHA-384, and
SHA-512.

Preliminary measurements showed performance improvements of up to a factor
of 2, dependent on the message size, whether chunking is used and the size
of the chunks.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25161)

11 months agos390x: Add defines for new CPACF functions
Ingo Franzki [Wed, 31 Jan 2024 15:26:52 +0000 (16:26 +0100)] 
s390x: Add defines for new CPACF functions

Add defines for new CPACF functions codes, its required MSA levels, and
document how to disable these functions via the OPENSSL_s390xcap environment
variable.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25161)

11 months agoExplicitly include e_os.h for close()
Tomas Mraz [Mon, 19 Aug 2024 09:34:27 +0000 (11:34 +0200)] 
Explicitly include e_os.h for close()

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25229)

(cherry picked from commit 0c0c6954bf4fa7b56e21e1393c9e5e5d55c1b2d6)

11 months agoRAND_write_file(): Avoid potential file descriptor leak
shridhar kalavagunta [Sun, 4 Aug 2024 21:04:53 +0000 (16:04 -0500)] 
RAND_write_file(): Avoid potential file descriptor leak

If fdopen() call fails we need to close the fd. Also
return early as this is most likely some fatal error.

Fixes #25064

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

11 months agoCI: Fix GCM IV check in acvp_test for crosstest
slontis [Mon, 19 Aug 2024 03:52:24 +0000 (13:52 +1000)] 
CI: Fix GCM IV check in acvp_test for crosstest

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

11 months agospeed.c: Return success with -testmode -async_jobs if not ASYNC_is_capable()
Tomas Mraz [Fri, 16 Aug 2024 09:54:00 +0000 (11:54 +0200)] 
speed.c: Return success with -testmode -async_jobs if not ASYNC_is_capable()

Fixes #25203

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25204)

11 months agotest: add a default greeting to avoid printing a null pointer.
Pauli [Sun, 18 Aug 2024 22:31:15 +0000 (08:31 +1000)] 
test: add a default greeting to avoid printing a null pointer.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/25221)

11 months agoAdd an indicator for AES GCM that returns if the iv has been generated
slontis [Wed, 14 Aug 2024 07:21:54 +0000 (17:21 +1000)] 
Add an indicator for AES GCM that returns if the iv has been generated
internally.

This is not using a strict check since there may be applications that
require the IV to be generated externally (e.g. java).

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

11 months agolist_tls_signatures(): Avoid leak with zero length builtin_sigalgs
Andrew Dinh [Fri, 16 Aug 2024 13:55:16 +0000 (20:55 +0700)] 
list_tls_signatures(): Avoid leak with zero length builtin_sigalgs

Fixes Coverity 1616307

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

11 months agoWe can't check policy if we got an empty stack of certs
Dmitry Belyavskiy [Wed, 14 Aug 2024 12:40:39 +0000 (14:40 +0200)] 
We can't check policy if we got an empty stack of certs

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

11 months agoMove docker files to test
Neil Horman [Thu, 15 Aug 2024 13:48:42 +0000 (09:48 -0400)] 
Move docker files to test

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25091)

11 months agoAdd workflow to do nightly build of interop container and push to quay
Neil Horman [Mon, 5 Aug 2024 20:52:06 +0000 (16:52 -0400)] 
Add workflow to do nightly build of interop container and push to quay

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25091)

11 months agoAdd dockerfile for generation of a quic interop container
Neil Horman [Mon, 5 Aug 2024 20:42:06 +0000 (16:42 -0400)] 
Add dockerfile for generation of a quic interop container

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25091)

11 months agoFix unpredictible refcount handling of d2i functions
Bernd Edlinger [Tue, 12 Mar 2024 19:04:56 +0000 (20:04 +0100)] 
Fix unpredictible refcount handling of d2i functions

The passed in reference of a ref-counted object
is free'd by d2i functions in the error handling.
However if it is not the last reference, the
in/out reference variable is not set to null here.
This makes it impossible for the caller to handle
the error correctly, because there are numerous
cases where the passed in reference is free'd
and set to null, while in other cases, where the
passed in reference is not free'd, the reference
is left untouched.

Therefore the passed in reference must be set
to NULL even when it was not the last reference.

Fixes #23713

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

11 months agoExtend test case for reused PEM_ASN1_read_bio
Bernd Edlinger [Fri, 24 Nov 2023 06:02:35 +0000 (07:02 +0100)] 
Extend test case for reused PEM_ASN1_read_bio

This is related to #22780, simply add test cases
for the different failure modes of PEM_ASN1_read_bio.
Depending on whether the PEM or the DER format is valid or not,
the passed in CRL may be deleted ot not, therefore a statement
like this:

reused_crl = PEM_read_bio_X509_CRL(b, &reused_crl, NULL, NULL);

must be avoided, because it can create memory leaks.

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

11 months agoreplace static declarations
Pauli [Fri, 16 Aug 2024 01:31:43 +0000 (11:31 +1000)] 
replace static declarations

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "fipsinstall: add ed_no_verify_digested option"
Pauli [Wed, 14 Aug 2024 23:53:04 +0000 (09:53 +1000)] 
Revert "fipsinstall: add ed_no_verify_digested option"

This reverts commit 70b6d57fd94fe11fa2510bc8026fa6a6ead51d68.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "doc: add documentation for -eddsa_no_verify_digested fipsinstall option"
Pauli [Wed, 14 Aug 2024 23:52:10 +0000 (09:52 +1000)] 
Revert "doc: add documentation for -eddsa_no_verify_digested fipsinstall option"

This reverts commit b00ea9a6a2a72f5ac7b38e82c9a7b6796972fc36.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "doc: add verify-digested param for EdDSA"
Pauli [Wed, 14 Aug 2024 23:52:09 +0000 (09:52 +1000)] 
Revert "doc: add verify-digested param for EdDSA"

This reverts commit ab02a297eb3d7f314eea371038c0b8e4038f658b.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "param: add OSSL_SIGNATURE_PARAM_EDDSA_VERIFY_DIGESTED"
Pauli [Wed, 14 Aug 2024 23:52:06 +0000 (09:52 +1000)] 
Revert "param: add OSSL_SIGNATURE_PARAM_EDDSA_VERIFY_DIGESTED"

This reverts commit 5abd7e5f796a9564c5f020053833deee1b9f7c6e.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "fips: add no digested option to FIPS provider"
Pauli [Wed, 14 Aug 2024 23:52:04 +0000 (09:52 +1000)] 
Revert "fips: add no digested option to FIPS provider"

This reverts commit 889277effb65b7f276e375cf0176c4c8597f4203.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "EdDSA: disallow verification from a pregenerated hash when in FIPS"
Pauli [Wed, 14 Aug 2024 23:51:08 +0000 (09:51 +1000)] 
Revert "EdDSA: disallow verification from a pregenerated hash when in FIPS"

This reverts commit 2d759937e2ee78c27c83f1433f79b33256ab1a39.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "test: update EdDSA tests for FIPS and no pre-hashing"
Pauli [Wed, 14 Aug 2024 23:51:07 +0000 (09:51 +1000)] 
Revert "test: update EdDSA tests for FIPS and no pre-hashing"

This reverts commit 09eaf16771fe5b5b57cac0ddfd6bf8ca3584134b.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "test: omit failing test when using a FIPS provider that supports eddsa_no_ver...
Pauli [Wed, 14 Aug 2024 23:51:02 +0000 (09:51 +1000)] 
Revert "test: omit failing test when using a FIPS provider that supports eddsa_no_verify_digested"

This reverts commit 54933db9f0e1a03b644cecc6735f8f2025b748b5.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoRevert "Apply the FIPS_eddsa_no_verify_digested indicator on prehash EdDSA only"
Pauli [Wed, 14 Aug 2024 23:49:05 +0000 (09:49 +1000)] 
Revert "Apply the FIPS_eddsa_no_verify_digested indicator on prehash EdDSA only"

This reverts commit ca112fccdd34a8538f14ddf8c3569b8331eae357.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25192)

11 months agoFIPS: Remove ability to bypass the FIPS self tests
slontis [Fri, 9 Aug 2024 02:29:04 +0000 (12:29 +1000)] 
FIPS: Remove ability to bypass the FIPS self tests

This is a FIPS 140-3 requirement.
It should not be done as a FIPS indicator.

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

11 months agoChange existing evp_test KeyGen Ctrls to use provider algorithm
slontis [Fri, 26 Jul 2024 03:42:09 +0000 (13:42 +1000)] 
Change existing evp_test KeyGen Ctrls to use provider algorithm
parameter names.

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

11 months agoUpdate evp_test KeyGen
slontis [Fri, 26 Jul 2024 03:31:42 +0000 (13:31 +1000)] 
Update evp_test KeyGen

The EVP_PKEY_CTX is now created in keygen_test_run().
keygen_test_parse() inserts all values into KEYGEN_TEST_DATA.
The 'Ctrl' parameters have been changed to just be settables,
rather than using legacy controls.

Added EC keygen tests

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

11 months agoRestrict FIPS EC Keygen to only allow curves with a security strength
slontis [Fri, 26 Jul 2024 00:23:57 +0000 (10:23 +1000)] 
Restrict FIPS EC Keygen to only allow curves with a security strength
>=112 bits

Add a FIPS indicator to EC keygen

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

11 months agoEnsure the msg_callback is called on CCS receipt in TLSv1.3
Matt Caswell [Mon, 12 Aug 2024 15:41:56 +0000 (16:41 +0100)] 
Ensure the msg_callback is called on CCS receipt in TLSv1.3

CCS records are ignore in TLSv1.3. But we should still call the msg_callback
anyway.

Fixes #25166

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/25169)

11 months agoAdd FIPS Indicator for ECDH cofactor.
slontis [Thu, 8 Aug 2024 06:56:22 +0000 (16:56 +1000)] 
Add FIPS Indicator for ECDH cofactor.

FIPS KAS requires use of ECC CDH.

The EC 'B' and 'K' curves have a cofactor that is not 1, and this
MUST be multiplied by the private key when deriving the shared secret.

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

11 months agoapps/cms.c, apps/smime.c: Fix -crlfeol help messages
Andreas Treichel [Sat, 18 May 2024 06:27:46 +0000 (08:27 +0200)] 
apps/cms.c, apps/smime.c: Fix -crlfeol help messages

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24434)

11 months agoFix SSL_CTX_set1_groups documentation on preference orders
David Benjamin [Fri, 8 Mar 2024 04:38:58 +0000 (23:38 -0500)] 
Fix SSL_CTX_set1_groups documentation on preference orders

The documentation currently describes SSL_CTX_set1_groups as a
preference order, but this does not match the typical interpretation of
"preference order" in OpenSSL and TLS. Typically, an application can
order more secure options ahead of less secure ones and pick up TLS's
usual downgrade protection guarantees.

TLS 1.3 servers need to balance an additional consideration: some
options will perform worse than others due to key share prediction. The
prototypical selection procedure is to first select the set of more
secure options, then select the most performant among those.

OpenSSL follows this procedure, but it *unconditionally* treats all
configured curves as equivalent security. Per discussion on GitHub,
OpenSSL's position is that this is an intended behavior.

While not supported by built-in providers, OpenSSL now documents that
external providers can extend the group list and CHANGES.md explicitly
cites post-quantum as a use case. With post-quantum providers, it's
unlikely that application developers actually wanted options to be
equivalent security. To avoid security vulnerabilities arising from
mismatched expectations, update the documentation to clarify the server
behavior.

Per the OTC decision in
https://github.com/openssl/openssl/issues/22203#issuecomment-1744465829,
this documentation fix should be backported to stable branches.

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

11 months agoapps/req.c: No warning reading from stdin if redirected
Bhaskar Metiya [Wed, 14 Aug 2024 07:27:14 +0000 (12:57 +0530)] 
apps/req.c: No warning reading from stdin if redirected

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25179)

11 months agoReturn SSL_AD_DECRYPT_ERROR alert on PSK binder validation failure (RFC 8446)
Bhaskar Metiya [Wed, 14 Aug 2024 06:04:01 +0000 (11:34 +0530)] 
Return SSL_AD_DECRYPT_ERROR alert on PSK binder validation failure (RFC 8446)

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25176)

11 months agofips: allow to customize provider vendor name
Dimitri John Ledkov [Fri, 10 May 2024 10:58:18 +0000 (11:58 +0100)] 
fips: allow to customize provider vendor name

FIPS providers need to specify identifiable names and versions. Allow
to customize the fips provider name prefix, via VERSION.dat which
already allows to customize version & buildinfo. With this patch
in-place it removes the need of patching code to set customized
provider name.

E.g. echo FIPS_VENDOR=ACME >> VERSION.dat, results in

```
$ OPENSSL_CONF=fips-and-base.cnf ../util/wrap.pl ../apps/openssl list -providers --verbose
Providers:
  base
    name: OpenSSL Base Provider
    version: 3.4.0
    status: active
    build info: 3.4.0-dev
    gettable provider parameters:
      name: pointer to a UTF8 encoded string (arbitrary size)
      version: pointer to a UTF8 encoded string (arbitrary size)
      buildinfo: pointer to a UTF8 encoded string (arbitrary size)
      status: integer (arbitrary size)
  fips
    name: ACME FIPS Provider for OpenSSL
    version: 3.4.0
    status: active
    build info: 3.4.0-dev
    gettable provider parameters:
      name: pointer to a UTF8 encoded string (arbitrary size)
      version: pointer to a UTF8 encoded string (arbitrary size)
      buildinfo: pointer to a UTF8 encoded string (arbitrary size)
      status: integer (arbitrary size)
      security-checks: integer (arbitrary size)
      tls1-prf-ems-check: integer (arbitrary size)
      drbg-no-trunc-md: integer (arbitrary size)
```

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

11 months agoApply the FIPS_eddsa_no_verify_digested indicator on prehash EdDSA only
Tomas Mraz [Wed, 14 Aug 2024 15:36:56 +0000 (17:36 +0200)] 
Apply the FIPS_eddsa_no_verify_digested indicator on prehash EdDSA only

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25188)

11 months agoDon't compile in support for DSA speed testing if not needed
Matt Caswell [Mon, 12 Aug 2024 08:32:56 +0000 (09:32 +0100)] 
Don't compile in support for DSA speed testing if not needed

If there is no DSA support in the library we should not compile in support
for speed testing of DSA. We should skip it in much the same way that we
do for other algorithms.

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

11 months agoFix a memory leak in the speed app
Matt Caswell [Mon, 12 Aug 2024 08:04:19 +0000 (09:04 +0100)] 
Fix a memory leak in the speed app

Make sure we free the ecdsa_key object after we have finished using it.

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

11 months agoAdd a test recipe for testing the speed command
Matt Caswell [Fri, 9 Aug 2024 14:59:16 +0000 (15:59 +0100)] 
Add a test recipe for testing the speed command

Previously there was no test for the speed command. We just do some simple
testing, running the command with various options to confirm that it doesn't
crash or report errors. We use the new -testmode option to ensure that this
happens quickly and doesn't really run full speed tests.

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

11 months agoDocument the new -testmode option to the speed command
Matt Caswell [Fri, 9 Aug 2024 13:43:01 +0000 (14:43 +0100)] 
Document the new -testmode option to the speed command

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

11 months agoAdd a test mode to the speed app
Matt Caswell [Fri, 9 Aug 2024 12:27:11 +0000 (13:27 +0100)] 
Add a test mode to the speed app

We add a testmode option to the speed app which simply runs 1 iteration of
any speed tests. If anything fails along the way the app returns an error
code.

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

11 months agoUpdate krb5 to latest master to pick up CVE fixes
Shih-Yi Chen [Wed, 7 Aug 2024 21:33:53 +0000 (21:33 +0000)] 
Update krb5 to latest master to pick up CVE fixes

CLA: trivial

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

(cherry picked from commit 099a71b48b6e1f27f39b2905fb67f2afaefd9171)

11 months agoAdd EDDSA FIPS self tests.
slontis [Fri, 15 Sep 2023 02:40:39 +0000 (12:40 +1000)] 
Add EDDSA FIPS self tests.

See FIPS 140-3 IG Section 10.3.A Part 11
Indicates ECDSA requires a sign and verify test.
Note 11 states that HashEdDSA is not required to be tested if PureEdDSA is tested.
Note 12 indicates that both ED25519 and X448 need to be tested.

Since ED uses the oneshot interface, additional API's needed to be exposed to the
FIPS provider using #ifdef FIPS_MODULE.

Changed ED25518 and ED448 to use fips=true in the FIPS provider.
Updated documentation for provider lists for EDDSA.

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

11 months agoImprove the EVP_PKEY_CTX_set_kem_op() documentation
Dmitry Belyavskiy [Mon, 12 Aug 2024 12:42:59 +0000 (14:42 +0200)] 
Improve the EVP_PKEY_CTX_set_kem_op() documentation

Fixes #25142

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25164)

11 months agotest: Improve coverage for the PBKDF2 unit tests
Pauli [Mon, 12 Aug 2024 01:08:09 +0000 (11:08 +1000)] 
test: Improve coverage for the PBKDF2 unit tests

Fixes #25136

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25160)

11 months agoEncap/decap in pkeyutl - tests
Dmitry Belyavskiy [Thu, 8 Aug 2024 11:45:19 +0000 (13:45 +0200)] 
Encap/decap in pkeyutl - tests

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25127)

11 months agoEncap/decap in pkeyutl - documentation
Dmitry Belyavskiy [Wed, 7 Aug 2024 15:50:51 +0000 (17:50 +0200)] 
Encap/decap in pkeyutl - documentation

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25127)

11 months agoSupport of en/decapsulation in the pkeyutl command
Dmitry Belyavskiy [Wed, 7 Aug 2024 15:17:18 +0000 (17:17 +0200)] 
Support of en/decapsulation in the pkeyutl command

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25127)

11 months agoadds TLS signature algorithms list feature
Michael Baentsch [Tue, 9 Jul 2024 09:07:01 +0000 (11:07 +0200)] 
adds TLS signature algorithms list feature

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24821)

11 months agoRestrict salt length for RSA-PSS in the FIPS provider
pohsingwu [Wed, 7 Aug 2024 02:24:36 +0000 (10:24 +0800)] 
Restrict salt length for RSA-PSS in the FIPS provider

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25115)

11 months agoSetup padding mode correctly in acvp_test
pohsingwu [Tue, 6 Aug 2024 14:40:00 +0000 (22:40 +0800)] 
Setup padding mode correctly in acvp_test

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25115)

11 months agofipsmodule.cnf: set the signature digest checks option on installation
Pauli [Mon, 29 Jul 2024 02:42:58 +0000 (12:42 +1000)] 
fipsmodule.cnf: set the signature digest checks option on installation

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25020)

11 months agofips: support signature-digest-checks in FIPS provider
Pauli [Mon, 29 Jul 2024 02:39:39 +0000 (12:39 +1000)] 
fips: support signature-digest-checks in FIPS provider

Fixes #24936

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25020)

11 months agotest: add unit tests for disallowed XOF digests
Pauli [Mon, 29 Jul 2024 02:24:18 +0000 (12:24 +1000)] 
test: add unit tests for disallowed XOF digests

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25020)

11 months agosignatures: disallow XOF digests when doing signatures
Pauli [Mon, 29 Jul 2024 02:07:39 +0000 (12:07 +1000)] 
signatures: disallow XOF digests when doing signatures

Except for Ed448 and RSA PSS where they are mandatory and allow respectively.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25020)