]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
4 months agoKeep the provided peer EVP_PKEY in the EVP_PKEY_CTX too openssl-3.1
Tomas Mraz [Tue, 4 Mar 2025 17:43:18 +0000 (18:43 +0100)] 
Keep the provided peer EVP_PKEY in the EVP_PKEY_CTX too

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

(cherry picked from commit 2656922febfc36f6b44cff1c363917685633b4c5)

4 months agoUpdated SSL_SESSION_get0_hostname() documentation to be consistent with the function
RSA-1977 [Fri, 24 Jan 2025 17:09:56 +0000 (12:09 -0500)] 
Updated SSL_SESSION_get0_hostname() documentation to be consistent with the function

CLA: trivial

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

(cherry picked from commit 8d6fd6142b0b55ce029df6d7b63dda5f7cb8ce54)

5 months agocompiler-zoo.yml: Switch to ubuntu-22.04 where possible
Tomas Mraz [Tue, 4 Mar 2025 15:20:16 +0000 (16:20 +0100)] 
compiler-zoo.yml: Switch to ubuntu-22.04 where possible

And drop the rest.

The ubuntu-20.04 CI runners are discontinued.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26971)

(cherry picked from commit 4e9b542868890428f0294a4ce53fcde68c1fcaf7)

5 months agoUpdate doc README URLs
14MM4CH1N3 [Fri, 14 Feb 2025 17:11:01 +0000 (12:11 -0500)] 
Update doc README URLs

This updates the openssl documentation link to the one currently in use,
and removes the standards.txt section as that URL leads to the normal
documentation page and there is no "standards" page in the openssl
documentation site.

CLA: trivial

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

(cherry picked from commit da44eb2901bd541f86547d814f45ab305b918611)

5 months agoFix hashsum files in release assets
Dmitry Misharov [Wed, 26 Feb 2025 08:13:36 +0000 (09:13 +0100)] 
Fix hashsum files in release assets

We use the coreutils format since 3.4.0.

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

(cherry picked from commit 808a0861716e6dd5e1c9f08cebec93084f028fd8)

5 months agoFix libctx passing for CMS PWRI use
Jakub Zelenka [Fri, 28 Feb 2025 16:04:50 +0000 (17:04 +0100)] 
Fix libctx passing for CMS PWRI use

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

(cherry picked from commit 5045712d3dbe6abdfffcb4f518c67409ec85535e)

5 months agoEncoder : Fix floating pointer when OSSL_ENCODER_to_data() is called
slontis [Tue, 25 Feb 2025 06:03:38 +0000 (17:03 +1100)] 
Encoder : Fix floating pointer when OSSL_ENCODER_to_data() is called
twice.

Fixes #26862

This only happens when using the FIPS provider, since it needs to export
the key.

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

(cherry picked from commit c2f4d7aae1c7c726eb1f8226d3d454dfd9754758)

5 months agoTolerate 3.5+ FIPS providers in kem_rsa_params test
Viktor Dukhovni [Wed, 26 Feb 2025 09:59:38 +0000 (20:59 +1100)] 
Tolerate 3.5+ FIPS providers in kem_rsa_params test

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

(cherry picked from commit 23cdc7732867e15cbf6de75fe734b5d3d49f7507)

5 months agoadd_uris_recursive(): Avoid OSSL_STORE_INFO leak on error
Tomas Mraz [Wed, 22 Jan 2025 08:57:36 +0000 (09:57 +0100)] 
add_uris_recursive(): Avoid OSSL_STORE_INFO leak on error

Fixes #26480

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

(cherry picked from commit be5965acad7a1c45e49411bcf4abad99d106a7c1)

5 months agoFix potential leak in error path in cert_response()
Niels Dossche [Wed, 22 Jan 2025 13:35:25 +0000 (14:35 +0100)] 
Fix potential leak in error path in cert_response()

get1_cert_status() returns an object that must be freed,
but the error path does not do that.
Fix it by adding a call to X509_free() in the error path.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26513)

(cherry picked from commit 56160f173d055486357b7a315ab4e9579b2538d5)

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)

(cherry picked from commit 6d42072e0b9e52fbeee28cb451e2ec269b329708)

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)

(cherry picked from commit 51597e2ee6ef4a384167bb1ed3528da1ab578d61)

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)

(cherry picked from commit 3240427a8530f5aa6070f135e954e20e591fa132)

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)

(cherry picked from commit 00a173af77c878065c1370a40782aac04c4c83a8)

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)

(cherry picked from commit c5eb70de753605cda978fda9a4eddbdb1fc692be)

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)

(cherry picked from commit 20a2f3beba9be6e226a0633b60c29e8a928ccd21)

5 months agoReplace snprintf with BIO_snprintf
Kim, Hyuk [Fri, 14 Feb 2025 01:48:31 +0000 (10:48 +0900)] 
Replace snprintf with BIO_snprintf

Updated snprintf to BIO_snprintf for consistency with previous changes. #24008

CLA: trivial

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

(cherry picked from commit aa6b7ac875a79ef2ef5376dfe79ce8402b702724)

5 months agoSPARC assembly: Don't file aes-cbc on T4 with small sizes.
Sebastian Andrzej Siewior [Tue, 8 Oct 2024 20:38:17 +0000 (22:38 +0200)] 
SPARC assembly: Don't file aes-cbc on T4 with small sizes.

The "openssl speed -testmode -seconds 1 -bytes 1 aes-128-cbc" test
revealed that the assembly code is crashing if length is less than 16.
The code shifts the provided length by 4 and than subtracts one until
the length hits zero. If it was already zero then it underflows the
counter and continues until it segfaults on reading or writing.

Replace the check against 0 with less than 15.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25637)

(cherry picked from commit c71c65b9222135a767c39a24cb254ed792d1c942)

5 months agoPrepare for 3.1.9 26705/head
openssl-machine [Tue, 11 Feb 2025 14:42:27 +0000 (14:42 +0000)] 
Prepare for 3.1.9

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

5 months agoPrepare for release of 3.1.8 openssl-3.1.8
openssl-machine [Tue, 11 Feb 2025 14:42:21 +0000 (14:42 +0000)] 
Prepare for release of 3.1.8

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

5 months agomake update
openssl-machine [Tue, 11 Feb 2025 14:42:20 +0000 (14:42 +0000)] 
make update

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

5 months agoCopyright year updates
openssl-machine [Tue, 11 Feb 2025 14:40:50 +0000 (14:40 +0000)] 
Copyright year updates

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

5 months agoFix compile error when building VC-WIN64-CLANGASM-ARM target
Auto Vincent [Thu, 30 Jan 2025 18:03:49 +0000 (18:03 +0000)] 
Fix compile error when building VC-WIN64-CLANGASM-ARM target

With MSVC v143, C++ Clang Compiler for Windows (18.1.8) there are
many errors similar to:

crypto\aes\libcrypto-lib-aesv8-armx.obj.asm:3795:7: error: unknown token in expression
        ld1     {v2.16b},[x0],#16

CLA: trivial

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

(cherry picked from commit becc0078f8215ffc062f5ba06c73ba51d3b14b6e)

5 months agobackport make-release.yml workflow to openssl-3.x branches
Dmitry Misharov [Thu, 23 Jan 2025 15:40:31 +0000 (16:40 +0100)] 
backport make-release.yml workflow to openssl-3.x branches

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

(cherry picked from commit 39cd63bdc9b584536019c07e39b2043a14378ffe)

6 months agoFix passing struct by value rather than by reference to syscall
Mae [Wed, 22 Jan 2025 16:54:43 +0000 (16:54 +0000)] 
Fix passing struct by value rather than by reference to syscall

Fixes #26521

CLA: trivial

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

(cherry picked from commit b6f2ff93639d9c71aae62dfc72082dd0829c2170)

6 months agoFix data race in asn1_str2tag() on tntmp which was accidentally made static
Stas Cymbalov [Tue, 21 Jan 2025 13:42:19 +0000 (16:42 +0300)] 
Fix data race in asn1_str2tag() on tntmp which was accidentally made static

Variables tntmp and tnst are declared in the same declaration and thus
share storage class specifiers (static). This is unfortunate as tntmp is
used during iteration through tnst array and shouldn't be static.
In particular this leads to two problems that may arise when multiple
threads are executing asn1_str2tag() concurrently:
1. asn1_str2tag() might return value that doesn't correspond to tagstr
   parameter. This can happen if other thread modifies tntmp to point to
   a different tnst element right after a successful name check in the
   if statement.
2. asn1_str2tag() might perform an out-of-bounds read of tnst array.
   This can happen when multiple threads all first execute tntmp = tnst;
   line and then start executing the loop. If that case those threads
   can end up incrementing tntmp past the end of tnst array.

CLA: trivial

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

(cherry picked from commit 7262c0bcc468ab8e43ba96ca219acdb4667e45e0)

6 months agoeddsa_signverify_init(): Avoid memory leak on error
Tomas Mraz [Tue, 21 Jan 2025 13:42:28 +0000 (14:42 +0100)] 
eddsa_signverify_init(): Avoid memory leak on error

Add missing WPACKET_cleanup() call.
Fixes Coverity 1638693

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

(cherry picked from commit abbc4073145cb6b2ea221f3e34809e9aefece9ab)

6 months agomac_legacy_kmgmt.c: Avoid possible memory leak on error
Tomas Mraz [Tue, 21 Jan 2025 13:38:23 +0000 (14:38 +0100)] 
mac_legacy_kmgmt.c: Avoid possible memory leak on error

Use mac_gen_cleanup() instead of just freeing the gctx.
Fixes Coverity 1638702

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

(cherry picked from commit 2455ef2112997d6a366623a209f1d0090ed2d847)

6 months agotest_kdf_scrypt(): Test resetting the KDF context
Tomas Mraz [Mon, 20 Jan 2025 08:16:30 +0000 (09:16 +0100)] 
test_kdf_scrypt(): Test resetting the KDF context

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

(cherry picked from commit 4f7d2b48093fd5147c652da319e43baea61a6218)

6 months agokdf_scrypt_reset(): NULLify freed pointers
Tomas Mraz [Mon, 20 Jan 2025 07:53:21 +0000 (08:53 +0100)] 
kdf_scrypt_reset(): NULLify freed pointers

Otherwise doublefree happens with further usage.

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

(cherry picked from commit 901b108154fd8d28516b9b4bebde93ac5bc2a224)

6 months agoscrypt: Do not free the context itself when fetch fails
Tomas Mraz [Mon, 20 Jan 2025 07:50:48 +0000 (08:50 +0100)] 
scrypt: Do not free the context itself when fetch fails

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

(cherry picked from commit 2dded720223c6b84dcbeadbbcd1c6307fe815832)

6 months agoImprove ASN1_TIME_print documentation and output
Michael Baentsch [Wed, 8 Jan 2025 11:57:28 +0000 (12:57 +0100)] 
Improve ASN1_TIME_print documentation and output

This adds missing GMT indication when printing the local time as
it is converted to the UTC timezone before printing.

Also fixing the fractional seconds printing on EBCDIC platforms.

Fixes #26313

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26344)

(cherry picked from commit c81ff978667e7c0d792e02db7a02b7bc12433abd)

6 months agos_socket: naccept: close listening socket after accepting clients
Nadav Tasher [Fri, 20 Dec 2024 15:59:01 +0000 (17:59 +0200)] 
s_socket: naccept: close listening socket after accepting clients

When `-naccept` is passed (i.e with `s_server`), the listening socket remains open while handling
client, even after `naccept` is supposed to reach `0`.

This is caused to to the decrementation of `naccept` and closing of the socket
happening a little too late in the `do_server` function.

Signed-off-by: Nadav Tasher <tashernadav@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26228)

(cherry picked from commit 113c12ee8cee2be232a361da277a2ab48807eeed)

6 months agoAdd CHANGES.md and NEWS.md updates for CVE-2024-13176
Tomas Mraz [Wed, 15 Jan 2025 17:29:52 +0000 (18:29 +0100)] 
Add CHANGES.md and NEWS.md updates for CVE-2024-13176

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

(cherry picked from commit c3144e102571517df6c15ccc049fa3660ab3cb0a)

6 months agoFix timing side-channel in ECDSA signature computation
Tomas Mraz [Wed, 15 Jan 2025 17:27:02 +0000 (18:27 +0100)] 
Fix timing side-channel in ECDSA signature computation

There is a timing signal of around 300 nanoseconds when the top word of
the inverted ECDSA nonce value is zero. This can happen with significant
probability only for some of the supported elliptic curves. In particular
the NIST P-521 curve is affected. To be able to measure this leak, the
attacker process must either be located in the same physical computer or
must have a very fast network connection with low latency.

Attacks on ECDSA nonce are also known as Minerva attack.

Fixes CVE-2024-13176

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

(cherry picked from commit 63c40a66c5dc287485705d06122d3a6e74a6a203)

6 months agoIf you call X509_add_cert with cert == NULL and the X509_ADD_FLAG_UP_REF
otherddn1978 [Thu, 26 Dec 2024 10:26:34 +0000 (13:26 +0300)] 
If you call X509_add_cert with cert == NULL and the X509_ADD_FLAG_UP_REF
flag, it will сrash to X509_up_ref.  Passing NULL here is not valid,
return 0 if cert == NULL.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26267)

(cherry picked from commit 3c7db9e0fdf4706d91cedf5fca70b609bdc1677e)

6 months agoWorkaround for RSA on AArch64 Big Endian
Nikolay Nikolaev [Tue, 24 Dec 2024 11:26:09 +0000 (13:26 +0200)] 
Workaround for RSA on AArch64 Big Endian

10646160125 introduced and optimized RSA NEON implementation
for AArch64 architecture, namely Cortex-A72 and Neoverse N1.
This implementation is broken in Big Endian mode, which is not
widely used, therefore not properly verified.
Here we disable this optimized implementation when Big Endian
platform is used.

Fixes: #22687
CLA: trivial

Signed-off-by: Nikolay Nikolaev <nicknickolaev@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/26257)

(cherry picked from commit b26894ec6945656113fd9556527765aba08e4355)

6 months agoFix test failure in 30-test_evp_pkey_provided.t
Bernd Edlinger [Fri, 10 Jan 2025 18:58:46 +0000 (19:58 +0100)] 
Fix test failure in 30-test_evp_pkey_provided.t

In this test there is a random test output corruption.
`make test TESTS=test_evp_pkey_provided V=1` has some random output,
that can with a certain probability start a line with "ok" or so:

    # Setting up a OSSL_ENCODER context with passphrase
    # Testing with no encryption
jLixONcRPi/m64CGie4KKKDuGeTjtYwfima3BNYCGlgbLGeK3yYxBfZb9JjviOJ4
    # nHaNsRsONTAKyg==

This happens because large random data is output to bio_out
but some data remains buffered, and then test_note() is used to print
some comments on the bio_err file.  This causes output corruption that
confuses the TAP parser.
Fix that by flushing any pending output with test_flush_stdout() first.

Fixes #23992

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

(cherry picked from commit c37f564bb8e25f825ff722642aaf735e8d74abb4)

6 months agoupdated (lib+)oqsprovider to latest releases
Michael Baentsch [Tue, 13 Jun 2023 15:30:30 +0000 (17:30 +0200)] 
updated (lib+)oqsprovider to latest releases

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(cherry picked from commit f3f3f86a14dac76f3079fb50cabd14fdab418bb0)

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

6 months agoFix obvious misspelling of ASN1_VALUE
Tom Cosgrove [Tue, 10 Dec 2024 11:31:11 +0000 (11:31 +0000)] 
Fix obvious misspelling of ASN1_VALUE

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26118)

(cherry picked from commit 4188ab2b198a5c9f302e15c5e08c3c095389b6e5)

6 months agoFix double 'the's
Tom Cosgrove [Thu, 5 Dec 2024 09:08:42 +0000 (09:08 +0000)] 
Fix double 'the's

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26118)

(cherry picked from commit 690bb5192c7ef36f427dddf9719b938d76837b23)

6 months agoFix intermittent test failure in 80-test_cmp_http.t
Bernd Edlinger [Thu, 9 Jan 2025 14:14:15 +0000 (15:14 +0100)] 
Fix intermittent test failure in 80-test_cmp_http.t

output to stderr is unbuffered bypassing the normal output, which does
not happen at line boundaries and is therefore confusing the TAP parser.
This is known to cause random test failures like this one:

80-test_cmp_http.t                    (Wstat: 0 Tests: 5 Failed: 0)
  Parse errors: Tests out of sequence.  Found (6) but expected (5)
                Bad plan.  You planned 6 tests but ran 5.

Fixes #23992

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26364)

6 months agospeed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers
Ingo Franzki [Wed, 8 Jan 2025 15:00:33 +0000 (16:00 +0100)] 
speed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers

Some (non-AEAD) ciphers require an IV to be used. Always pass a (dummy) IV
when setting the key. It is ignored by ciphers that do not use an IV.

Commit 607a46d003f472d4bce646f3df6e85725094d68a corrected the use of AEAD
ciphers, but removed the IV from being passed to EVP_CipherInit_ex() for
non-AEAD ciphers.

Fixes: https://github.com/openssl/openssl/commit/607a46d003f472d4bce646f3df6e85725094d68a
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26346)

(cherry picked from commit b8028d489037033a6eaa02b11755e5be0e688523)

6 months agoTake into account no_store when pushing algorithm
Dmitry Belyavskiy [Wed, 18 Dec 2024 20:28:14 +0000 (21:28 +0100)] 
Take into account no_store when pushing algorithm

When we put algorithm to the store, we have a fallback to the
OSSL_LIB_CTX level store when store is NULL.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(cherry picked from commit b3bb214720f20f3b126ae4b9c330e9a48b835415)

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26231)

6 months agoThis is a test for nocache provider behavior
Dmitry Belyavskiy [Tue, 17 Dec 2024 15:18:37 +0000 (16:18 +0100)] 
This is a test for nocache provider behavior

A follow-up to #26038

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(cherry picked from commit f6097c7c5da84a6bd354c57fd6e0ffb2b549f30d)

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26231)

6 months agoupdate tlsfuzzer to new version
Alicja Kario [Thu, 29 Aug 2024 17:39:10 +0000 (19:39 +0200)] 
update tlsfuzzer to new version

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26377)

(cherry picked from commit 290dfd2eead5ca9b938925e40b9ae5b7817252a4)

6 months agofix linux-arm64 and freebsd-x86_64 CI jobs
Dmitry Misharov [Fri, 10 Jan 2025 11:51:32 +0000 (12:51 +0100)] 
fix linux-arm64 and freebsd-x86_64 CI jobs

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

(cherry picked from commit 4b2f41b3ef7332e5e633c67f424c8a5d67e5f23d)

6 months agoFix buildinf.h generation for space and backslash
Kai Pastor [Sat, 4 Jan 2025 10:48:26 +0000 (11:48 +0100)] 
Fix buildinf.h generation for space and backslash

Builds may be configured with CC or CFLAGS containing space and
double quotes. In particular on Windows, this may lead to passing
more than two arguments into mkbuildinf.pl.
In addition, backslashes must be escaped for constructing the C string.

Fixes #26253.

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

(cherry picked from commit e87a3473fd1e9d901a89d4b14a53826723357701)

6 months agoReplace self-hosted runners with GitHub hosted
Dmitry Misharov [Thu, 2 Jan 2025 14:32:41 +0000 (15:32 +0100)] 
Replace self-hosted runners with GitHub hosted

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

(cherry picked from commit ea71f8cd40358bf11f2ef9a256bf99c5929379fb)

6 months agoFix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()
Frederik Wedel-Heinen [Sat, 21 Dec 2024 20:15:36 +0000 (21:15 +0100)] 
Fix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()

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

(cherry picked from commit d48874ab477be0fa3df11bfcc38c043b8f7ab8e2)

6 months agoFix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY
Richard Levitte [Wed, 8 Jan 2025 09:15:02 +0000 (10:15 +0100)] 
Fix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY

Fixes #26337

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

(cherry picked from commit 6a2472fb3e958c029989286d9272bd2b23738f85)

6 months agoReturn NULL from ossl_lib_ctx_get_concrete() when it is uninitialized
Frederik Wedel-Heinen [Sun, 5 Jan 2025 19:42:51 +0000 (20:42 +0100)] 
Return NULL from ossl_lib_ctx_get_concrete() when it is uninitialized

When default_context_inited is set to false we return NULL instead of
the global default context.

Fixes #25442

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

(cherry picked from commit dfce0d7418d6d5b54d74fa80fc50392f00270c53)

6 months agoFix potential memory leak in PKCS12_add_key_ex()
Niels Dossche [Mon, 28 Oct 2024 16:04:03 +0000 (17:04 +0100)] 
Fix potential memory leak in PKCS12_add_key_ex()

p8 is allocated using EVP_PKEY2PKCS8(), but when PKCS8_add_keyusage()
fails this memory is not freed. Fix this by adding a call to
PKCS8_PRIV_KEY_INFO_free().

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25818)

(cherry picked from commit f822a4866894ed8a752ad93c228fb76a8bb206e8)

6 months agoRun fuzz-checker workflow on ubuntu-24.04
Bernd Edlinger [Thu, 26 Dec 2024 15:30:16 +0000 (16:30 +0100)] 
Run fuzz-checker workflow on ubuntu-24.04

Fix missing afl++-clang package
Use clang-18
Configure ubsan with -fno-sanitize=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/26269)

(cherry picked from commit c45fddd5975797dab656849968fa010c2207a722)

6 months agoFix test failure in 90-test_memleak.t
Bernd Edlinger [Fri, 27 Dec 2024 22:02:47 +0000 (23:02 +0100)] 
Fix test failure in 90-test_memleak.t

recent gcc versions can optimize the memory leak away,
avoid that by declaring the lost variable to be volatile.

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

(cherry picked from commit eeb3266ebba6d70df31f20e4ebd46065fc917ce5)

6 months agoFix a minor memory sanitizer issue
Bernd Edlinger [Thu, 26 Dec 2024 10:56:17 +0000 (11:56 +0100)] 
Fix a minor memory sanitizer issue

Here the undefined value "npa" passed to a function
WPACKET_sub_memcpy_u16(pkt, npa, npalen).
However the value is not really used, because "npalen" is zero,
but the call statememt itself is considered an invalid operation
by the new sanitizer.

The original sanitizer error report was:

==49175==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55a276b29d6f in tls_construct_stoc_next_proto_neg /home/runner/work/openssl/openssl/ssl/statem/extensions_srvr.c:1518:21
    #1 0x55a276b15d7d in tls_construct_extensions /home/runner/work/openssl/openssl/ssl/statem/extensions.c:909:15
    #2 0x55a276b513dc in tls_construct_server_hello /home/runner/work/openssl/openssl/ssl/statem/statem_srvr.c:2471:10
    #3 0x55a276b2e160 in write_state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:896:26
    #4 0x55a276b2e160 in state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:490:21
    #5 0x55a276b2f562 in ossl_statem_accept /home/runner/work/openssl/openssl/ssl/statem/statem.c:309:12
    #6 0x55a276a9f867 in SSL_do_handshake /home/runner/work/openssl/openssl/ssl/ssl_lib.c:4890:19
    #7 0x55a276a9f605 in SSL_accept /home/runner/work/openssl/openssl/ssl/ssl_lib.c:2169:12
    #8 0x55a276a3d4db in create_bare_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1281:24
    #9 0x55a276a3d7cb in create_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1350:10
    #10 0x55a276a64c0b in test_npn /home/runner/work/openssl/openssl/test/sslapitest.c:12266:14
    #11 0x55a276b9fc20 in run_tests /home/runner/work/openssl/openssl/test/testutil/driver.c:377:21
    #12 0x55a276ba0b10 in main /home/runner/work/openssl/openssl/test/testutil/main.c:31:15

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

(cherry picked from commit e63e889b32a3503a992ed0d0d2d1138e06be0209)

6 months agoTry to work around the llvm-symbolizer failure
Bernd Edlinger [Fri, 27 Dec 2024 07:49:13 +0000 (08:49 +0100)] 
Try to work around the llvm-symbolizer failure

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

(cherry picked from commit 01e657c5468a637959395b07b385e58785c486f2)

6 months agoAdd -fno-sanitize=function to ubsan
Bernd Edlinger [Wed, 16 Oct 2024 14:37:32 +0000 (16:37 +0200)] 
Add -fno-sanitize=function to ubsan

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

(cherry picked from commit 5f0dab5e74b7cdb1b51217044966dc3927824a4d)

6 months agoClean up ASN1_STRING comment and improve example in docs
Job Snijders [Tue, 17 Dec 2024 13:05:49 +0000 (13:05 +0000)] 
Clean up ASN1_STRING comment and improve example in docs

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26195)

(cherry picked from commit 2e36bb07b50a1dc55f97aeccbec9fbc5048290d1)

6 months ago80-test_cms.t: Fix incorrect plan from bad merge
Tomas Mraz [Mon, 6 Jan 2025 12:03:59 +0000 (13:03 +0100)] 
80-test_cms.t: Fix incorrect plan from bad merge

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26322)

(cherry picked from commit ff10a027f94806c5daed42a1f6488759bed68cd3)

6 months agoFix CMS encryption with key agreement when originator set
Jakub Zelenka [Fri, 13 Dec 2024 12:48:23 +0000 (13:48 +0100)] 
Fix CMS encryption with key agreement when originator set

OpenSSL currently does not support encryption with originator flag so it
should fail nicely instead of segfaulting.

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26014)

(cherry picked from commit 894e69e747a93a1f166891f5f029b78c68088f50)

6 months agoFix originator cert leak in cms app
Jakub Zelenka [Fri, 13 Dec 2024 12:47:25 +0000 (13:47 +0100)] 
Fix originator cert leak in cms app

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26014)

(cherry picked from commit 24dd635efff48a24daf1e38a256550253225a28e)

6 months agoCorrect return value documentation for X509V3_set_ctx()
Michael Baentsch [Wed, 1 Jan 2025 18:27:45 +0000 (19:27 +0100)] 
Correct return value documentation for X509V3_set_ctx()

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

(cherry picked from commit 817a2b2b4955da0233fe7e6e4bd16c0255262b4f)

6 months agoFix GCC compilation -Waggressive-loop-optimizations
Adrien Zinger [Wed, 20 Mar 2024 08:39:16 +0000 (09:39 +0100)] 
Fix GCC compilation -Waggressive-loop-optimizations

GCC 13.1.0 were reporting a compilation warning with -O2/3 and
-Waggressive-loop-optimizations. GCC is raising an undefined behavior in the
while loop. Replace the while loop with a memset call at the top of the
function.

Fixes #21088

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23898)

(cherry picked from commit c45ca0656f8d1fe43b8cf444c88d295a063341ca)

7 months agoReject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert
cx [Thu, 26 Sep 2024 03:27:14 +0000 (11:27 +0800)] 
Reject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert

This changes the alert according to RFC 8446.

Fixes: #25402
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25547)

(cherry picked from commit 0f6caf740977fa25d0f05cd3c48a656efbd9a79e)

7 months agoFix potential memory leak in BIO_get_accept_socket()
Niels Dossche [Mon, 28 Oct 2024 15:34:55 +0000 (16:34 +0100)] 
Fix potential memory leak in BIO_get_accept_socket()

When BIO_parse_hostserv() fails it may still have allocated memory, yet
this memory is not freed. Fix it by jumping to the err label.

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

(cherry picked from commit 32476957ead4151dceaf873306fc7e79cd262812)

7 months agoossl_i2c_ASN1_BIT_STRING(): Fix a possible heap buffer overflow
Andrey Tsygunka [Tue, 26 Nov 2024 07:53:31 +0000 (10:53 +0300)] 
ossl_i2c_ASN1_BIT_STRING(): Fix a possible heap buffer overflow

When data contains only zero values a buffer overflow happens.

CLA: trivial

Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26190)

(cherry picked from commit bf2dea0e2c6f1cfe1a8222088052ebcc63ab1004)

7 months agoCheck whether ctx->pctx != NULL
otherddn1978 [Fri, 13 Dec 2024 15:00:09 +0000 (18:00 +0300)] 
Check whether ctx->pctx != NULL

If it is NULL, ctx->pctx->pmeth dereference will cause a crash.

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

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

(cherry picked from commit 82e7a1130a7d10f4e15c19676a680990b5e3f8fe)

7 months agoUpgrade action/{upload,download}-artifact to v4
Richard Levitte [Mon, 11 Nov 2024 10:45:54 +0000 (11:45 +0100)] 
Upgrade action/{upload,download}-artifact to v4

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

7 months agoFix typo in SSL_get_shared_sigalgs docs
Sasha Romijn [Wed, 11 Dec 2024 13:31:12 +0000 (14:31 +0100)] 
Fix typo in SSL_get_shared_sigalgs docs

psighash -> psignhash

CLA: trivial

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

(cherry picked from commit 1b3b5a019a8aab7e92f1a56123880e67fd22e1b5)

7 months agoX509: document non-standard behavior checking EKU extensions in CA and TA certs
Dr. David von Oheimb [Mon, 9 Dec 2024 21:22:24 +0000 (22:22 +0100)] 
X509: document non-standard behavior checking EKU extensions in CA and TA certs

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

(cherry picked from commit a82c2bf5c9db9d00f16281b48c1e1430a6cfd76e)

7 months agodh_cms_set_peerkey(): Fix the incorrect condition
Shakti Shah [Mon, 25 Nov 2024 15:16:45 +0000 (20:46 +0530)] 
dh_cms_set_peerkey(): Fix the incorrect condition

Only absent parameters allowed in RFC 3370.

Fixes #25824

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

(cherry picked from commit 02e72ccffacf2d01295810798ca1c86a438ee712)

7 months agoRemove references to git.openssl.org from README.md
Tom Cosgrove [Thu, 5 Dec 2024 17:27:52 +0000 (17:27 +0000)] 
Remove references to git.openssl.org from README.md

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

(cherry picked from commit 5f9814d95cc16a6e45e45cc2afe8b98c1eeead25)

8 months agoAvoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE
Tomas Mraz [Thu, 28 Nov 2024 09:10:28 +0000 (10:10 +0100)] 
Avoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE

We would dereference p7->d.sign pointer which can be NULL.

Reported by Han Zheng.

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

(cherry picked from commit f2348f1f844a54c7a95c32e2354cd29f0860c803)

8 months ago04-test_encoder_decoder.t: Add } omitted in a backport
Tomas Mraz [Fri, 29 Nov 2024 17:55:13 +0000 (18:55 +0100)] 
04-test_encoder_decoder.t: Add } omitted in a backport

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26085)

8 months agoFix EVP_PKEY_print_private() so that it works with non default providers.
slontis [Wed, 20 Nov 2024 01:39:35 +0000 (12:39 +1100)] 
Fix EVP_PKEY_print_private() so that it works with non default providers.

At some point in time it was decided that the EC keymanagers ec_export()
function would only allow the selection to be both the public + private
parts. If just the private element is selected it returns an error.
Many openssl commandline apps use EVP_PKEY_print_private() which passes
EVP_PKEY_PRIVATE_KEY to the encoder. This selection propagates to
encoder_construct_pkey(). For external providers (such as the fips
provider this will call the keymanagers export() with the selection set
to just the private part.

So we either need to
1) change the selection in EVP_PKEY_print_private() or
2) modify the selection used in the export used in
   encoder_construct_pkey
3) Change the ec_export to allow this.

I have chosen 2) but I am not sure if this is the correct thing to do
or whether it should conditionally do this when the output_type ==
'text'.

Issue was reported by Ilia Okomin (Oracle).

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

(cherry picked from commit 79c98fc6ccab49f02528e06cc046ac61f841a753)

8 months agodie() in .tmpl file should not be silently ignored.
Alexandr Nedvedicky [Tue, 26 Nov 2024 08:05:09 +0000 (09:05 +0100)] 
die() in .tmpl file should not be silently ignored.

call to die() in perl templates is currently ignored.
any error printed by die() commad appears in template
output.

In order to make sure die() terminates processing we
must ensure we emite `undef` value. This is ensured
by adding a `BROKEN` callback to `fill_in()` Template
method. The callback must return undef to stop processing.

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

(cherry picked from commit 578760bb6aae6a9d7f3805eea66bab124d06c9b0)

8 months agoDocument expected BIO operations for libssl
David Benjamin [Mon, 25 Nov 2024 16:01:17 +0000 (11:01 -0500)] 
Document expected BIO operations for libssl

If your custom BIO does not implement BIO_CTRL_FLUSH, it won't work, but
this is not document anywhere.

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

(cherry picked from commit 847a23757f7cbebaa882e15087efb926113a0670)

8 months agoSkip Asymmetric RSA corruption test for >=3.5 FIPS provider
Tomas Mraz [Mon, 25 Nov 2024 09:58:56 +0000 (10:58 +0100)] 
Skip Asymmetric RSA corruption test for >=3.5 FIPS provider

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26049)

(cherry picked from commit e50d4bac9d9018f09427f4600062a7415c1bdfc8)

8 months agoopenssl-pkeyutl.pod.in: improve description of -rawin and -digest options
Dr. David von Oheimb [Wed, 30 Oct 2024 19:37:38 +0000 (20:37 +0100)] 
openssl-pkeyutl.pod.in: improve description of -rawin and -digest options

Fixes #25827

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

(cherry picked from commit e26d56d2198fd4a0f7fbd62471a30af05539e38d)

8 months agoopenssl-pkeyutl.pod.in: add that -sign is default op, update claim on hash needed...
Dr. David von Oheimb [Tue, 29 Oct 2024 18:20:59 +0000 (19:20 +0100)] 
openssl-pkeyutl.pod.in: add that -sign is default op, update claim on hash needed for -sign/-verify, etc.

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

(cherry picked from commit 20c20b985a6c6d1f7b758a865fc96530c7b0c7b0)

8 months agoFix potential memory leak on failure of ecx_gen_init()
Niels Dossche [Wed, 20 Nov 2024 18:57:38 +0000 (19:57 +0100)] 
Fix potential memory leak on failure of ecx_gen_init()

When ecx_gen_set_params() returns 0, it could have duplicated the memory
for the parameter OSSL_KDF_PARAM_PROPERTIES already in gctx->propq,
leading to a memory leak.

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

(cherry picked from commit 98be2e8fb60aaece2e4c3d42e87671fe22c081a2)

8 months agoFix potential memory leak on failure of dsa_gen_init()
Niels Dossche [Wed, 20 Nov 2024 19:22:43 +0000 (20:22 +0100)] 
Fix potential memory leak on failure of dsa_gen_init()

When dsa_gen_set_params()  returns 0, it could have duplicated the memory for the parameter
OSSL_PKEY_PARAM_FFC_DIGEST already in gctx->mdname, leading to a memory leak.

Allocated here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L524
Can return 0 here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L529-L536

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

(cherry picked from commit d7e8f6f7816f2be3ab5e498d180424940fd58695)

8 months agoMark OPENSSL_armcap_P .hidden in arm asm
Kai Pastor [Sat, 23 Sep 2023 18:22:03 +0000 (20:22 +0200)] 
Mark OPENSSL_armcap_P .hidden in arm asm

Fixes #25601
Fixes #22414

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

(cherry picked from commit e131868678085f29adf90db8bd8058e9f2c8c6b0)

8 months agobuild_wincrypt_test.c: Fix compilation with MSVC
Mathias Berchtold [Fri, 21 Apr 2023 23:16:39 +0000 (17:16 -0600)] 
build_wincrypt_test.c: Fix compilation with MSVC

Fixes issue https://github.com/openssl/openssl/issues/20805

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(cherry picked from commit b5a635dc2113e1bc807ea358a670146c813df989)

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26018)

8 months agosm2_sig_verify(): Do not call BN_CTX_end() without BN_CTX_start()
Tomas Mraz [Tue, 19 Nov 2024 10:09:58 +0000 (11:09 +0100)] 
sm2_sig_verify(): Do not call BN_CTX_end() without BN_CTX_start()

In case of memory allocation failure this
could happen.

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

(cherry picked from commit 93bfe97c5be0ca575411b39c9dec1103caa82f51)

8 months agoci.yml: Remove remaining hack for self-hosted worker
Tomas Mraz [Fri, 15 Nov 2024 17:01:38 +0000 (18:01 +0100)] 
ci.yml: Remove remaining hack for self-hosted worker

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

8 months agoremove ternary from runs-on, security repo is hosted on github.com
Dmitry Misharov [Wed, 13 Nov 2024 14:35:43 +0000 (15:35 +0100)] 
remove ternary from runs-on, security repo is hosted on github.com

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

(cherry picked from commit 5c5b8d2d7c59fc48981861629bb0b75a03497440)

8 months agoman ECDSA_sign(3): fix wrong variable names
Alicja Kario [Mon, 11 Nov 2024 13:33:46 +0000 (14:33 +0100)] 
man ECDSA_sign(3): fix wrong variable names

the parameters in the function definitions use `siglen` not `sig_len`,
this fixes the doc text.

Signed-off-by: Alicja Kario <hkario@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25927)

(cherry picked from commit eaf4da97c9b9c09a407b9f1a47ad7dd99c05884c)

8 months agoapps/speed.c: Fix the benchmarking for AEAD ciphers
Mohammed Alhabib [Fri, 8 Nov 2024 11:40:49 +0000 (14:40 +0300)] 
apps/speed.c: Fix the benchmarking for AEAD ciphers

Fixed the benchmarking for the evp aead interface for ccm, gcm, ocb, and siv,
where decryption fails when executing
`openssl speed -evp aes-128-ccm -decrypt` and
`openssl speed -evp aes-128-gcm -decrypt`.

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

8 months agoFix error handling in CMS_EncryptedData_encrypt
Bernd Edlinger [Thu, 7 Sep 2023 16:05:44 +0000 (18:05 +0200)] 
Fix error handling in CMS_EncryptedData_encrypt

That caused several memory leaks in case of error.
Also when the CMS object that is created by CMS_EncryptedData_encrypt
is not used in the normal way, but instead just deleted
by CMS_ContentInfo_free some memory was lost.

Fixes #21985

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22044)

8 months agoBugfixes for params to legacy control translations for EC parameters
Vladimirs Ambrosovs [Wed, 1 Nov 2023 11:18:14 +0000 (13:18 +0200)] 
Bugfixes for params to legacy control translations for EC parameters

param->ctrl translation: Fix fix_ecdh_cofactor()

In POST_PARAMS_TO_CTRL state the fix_ecdh_cofactor() function should
return value in ctx->p1

param->ctrl translation: fix evp_pkey_ctx_setget_params_to_ctrl
 return

Since some of the ctrl operations may return 0 as valid value
(e.g. ecdh_cofactor value 0 is valid setting), before colling
POST_PARAMS_TO_CTRL, we need to check return value for 0 as well
otherwise the evp_pkey_ctx_setget_params_to_ctrl function fails
without a chance to fix the return value

param->ctrl translation: Set ecdh_cofactor default action_type GET

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

(cherry picked from commit 2aaef03339a88e5d693f278406a889657b10fd2d)

8 months agoAdjust naming authority formatting when printing out admission extension
oleg.hoefling [Mon, 28 Oct 2024 08:23:59 +0000 (09:23 +0100)] 
Adjust naming authority formatting when printing out admission extension

Indent namingAuthority section with two spaces to match the parent
node.

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25814)

(cherry picked from commit 85a52f7292cb57662f823e4ac1a303f56d0531bf)

8 months agoFix memory leak on failure in copy_issuer()
Niels Dossche [Tue, 5 Nov 2024 15:11:56 +0000 (16:11 +0100)] 
Fix memory leak on failure in copy_issuer()

When sk_GENERAL_NAME_reserve() fails, ialt is not freed.
Add the freeing operation in the common error path.

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

(cherry picked from commit fa856b0ce0f527d2f80c10c8c288201ace4a9efa)

8 months agoFix smime-type for AuthEnvelopedData
Jakub Zelenka [Tue, 17 Sep 2024 13:21:33 +0000 (14:21 +0100)] 
Fix smime-type for AuthEnvelopedData

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25523)

(cherry picked from commit 4c8c37e5720ac08cb777499a92b48fdae5aace9a)

8 months agoFix uses of `EVP_PKEY_Q_keygen` with `size_t` variadic argument
ArtSin [Mon, 4 Nov 2024 08:56:52 +0000 (12:56 +0400)] 
Fix uses of `EVP_PKEY_Q_keygen` with `size_t` variadic argument

Fix cases where `int` argument was passed instead of `size_t`.

CLA: trivial

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

(cherry picked from commit ccaa754b5f66cc50d8ecbac48b38268e2acd715e)

8 months agoFix the default_md example in the ca docs
Matt Caswell [Mon, 4 Nov 2024 09:00:32 +0000 (09:00 +0000)] 
Fix the default_md example in the ca docs

We should not have an example showing the default_md as md5.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25856)

(cherry picked from commit d1669a14d129c9b12c8ef5ccd3545273e50aad0f)

9 months agoFix incorrect openssl-smime doc sample command for encrypt
Zheyu Shen [Wed, 30 Oct 2024 08:34:12 +0000 (08:34 +0000)] 
Fix incorrect openssl-smime doc sample command for encrypt

Original documented sample command causes error. PEM recipient cert argument needs to go last.

CLA: trivial

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

(cherry picked from commit 1d160dbf39fbdba89389ddff54e45bacf278b04a)

9 months agofix: util/check-format-commit.sh - fix ending check
Richard Levitte [Sun, 27 Oct 2024 10:15:21 +0000 (11:15 +0100)] 
fix: util/check-format-commit.sh - fix ending check

Look at the end result instead of the file name it's stored in

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25810)

(cherry picked from commit 4c29044a83e1926a31ebb5ab8e01fabd0c9e240a)

9 months agoFix ambiguous output of Signature Algorithms
Bernd Edlinger [Thu, 24 Oct 2024 20:29:48 +0000 (22:29 +0200)] 
Fix ambiguous output of Signature Algorithms

Signature Algorithms are printed in a SIG+HASH format.
In some cases this is ambiguous like brainpool and RSA-PSS.
And the name of ed25519 and ed448 must be spelled in lower case,
so that the output can be used as a -sigalgs parameter value.

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

(cherry picked from commit f30d6ba455e06572250e75132045eedde5d1daf0)