]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
13 months agoFixes for potential deadlock
cchinchole [Tue, 2 Jul 2024 07:56:22 +0000 (02:56 -0500)] 
Fixes for potential deadlock

Fixes (#24517):
(3/3) Addresses the potential deadlock if an error occurs from up_ref
in functions ENGINE_get_first, ENGINE_get_last, ENGINE_get_next, and
ENGINE_get_prev in file crypto/engine/eng_list.c

CLA: trivial

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

(cherry picked from commit e6174ca4d48f6f4f954dd87f2cdf3718af14f064)

13 months agoConfigure: Remove -Wswitch-default from strict warnings
Tomas Mraz [Fri, 28 Jun 2024 08:34:23 +0000 (10:34 +0200)] 
Configure: Remove -Wswitch-default from strict warnings

Also move -Wno-tautological-constant-out-of-range-compare to
clang-specific options as it is not supported by gcc.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24758)

13 months agofix: remove some odd empty lines
Richard Levitte [Mon, 1 Jul 2024 13:28:39 +0000 (15:28 +0200)] 
fix: remove some odd empty lines

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

(cherry picked from commit cfe0bbdecadaebc6ad7ba5a3335b7a03522c434f)

13 months agofix: openssl speed: RSA encryption is on the pubkey, not the privkey
Richard Levitte [Mon, 1 Jul 2024 13:28:14 +0000 (15:28 +0200)] 
fix: openssl speed: RSA encryption is on the pubkey, not the privkey

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

(cherry picked from commit bb90a7861cbf27e29790b66077c23a2e9805014b)

13 months agoBIO_f_base64.pod and openssl-enc.pod.in: improve description on newline handling
Dr. David von Oheimb [Mon, 11 Jul 2022 17:55:10 +0000 (19:55 +0200)] 
BIO_f_base64.pod and openssl-enc.pod.in: improve description on newline handling

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

(cherry picked from commit b1e7bc5bdfc73ef841afa30ac321975b0d63219a)

13 months agoOPENSSL_hexstr2buf_ex(): Handle zero-length input correctly
Tomas Mraz [Mon, 1 Jul 2024 07:30:56 +0000 (09:30 +0200)] 
OPENSSL_hexstr2buf_ex(): Handle zero-length input correctly

In case of zero-length input the code wrote one byte
before the start of the output buffer. The length
of the output was also reported incorrectly in this case.

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

(cherry picked from commit 3f7b355733407cf777bfad5ce5b79610588bacc5)

13 months agoCheck EC_GROUP_get0_order result before dereference
JohnnySavages [Thu, 27 Jun 2024 01:59:52 +0000 (21:59 -0400)] 
Check EC_GROUP_get0_order result before dereference

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

(cherry picked from commit 16311dbf53c464726d73b76d77ecf6275c9f9d08)

13 months agoOpenSSL::Test: Avoid running IPv6 related tests if IPv6 was explicitly disabled
Richard Levitte [Thu, 27 Jun 2024 06:30:28 +0000 (08:30 +0200)] 
OpenSSL::Test: Avoid running IPv6 related tests if IPv6 was explicitly disabled

It's possible to disable IPv6  explicitly when configuring OpenSSL.  In that
case, IPv6 related tests should be skipped.

This is solved by having OpenSSL::Test::Utils::have_IPv6() check configuration
first, before trying to determine if the machine supports IPv6.

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

(cherry picked from commit 5a9c90b1e59b2c368876229862fbff29f2bcf006)

13 months agoClarify DRBG seeding.
Pauli [Thu, 27 Jun 2024 00:08:05 +0000 (10:08 +1000)] 
Clarify DRBG seeding.

There is a legacy code path that OpenSSL won't use anymore but applications
could.  Add a comment indicating this to avoid confusion for people not
intimately conversant with the nuances in the RNG code.

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

(cherry picked from commit 1eb122aa0ca152dc564e61674caf3f11acd85b57)

13 months agoAdd aix-clang and aix64-clang configuration
sanumesh [Tue, 11 Jun 2024 14:47:07 +0000 (09:47 -0500)] 
Add aix-clang and aix64-clang configuration

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

(cherry picked from commit 7afa7731e924d5ac10fc992d8cd777f407d33af9)

13 months agoFree appname if it was set after initializing crypto.
sgzmd [Tue, 25 Jun 2024 14:53:32 +0000 (15:53 +0100)] 
Free appname if it was set after initializing crypto.

Fixes #24729

CLA: trivial

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

(cherry picked from commit fbd6609bb21b125c9454d07c484d166a33b4815b)

13 months agodocs: document that *_free(NULL) does nothing
Vita Batrla [Tue, 25 Jun 2024 09:58:49 +0000 (11:58 +0200)] 
docs: document that *_free(NULL) does nothing

Explicitly documents that *_free(NULL) does nothing.
Fixes two cases where that wasn't true.
Fixes #24675.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Sasa Nedvedicky <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24735)

(cherry picked from commit 981d129a5609ee2e031367c34c67a9f61a5bfd66)

13 months agoAdd a test for an empty NextProto message
Matt Caswell [Fri, 21 Jun 2024 13:29:26 +0000 (14:29 +0100)] 
Add a test for an empty NextProto message

It is valid according to the spec for a NextProto message to have no
protocols listed in it. The OpenSSL implementation however does not allow
us to create such a message. In order to check that we work as expected
when communicating with a client that does generate such messages we have
to use a TLSProxy test.

Follow on from CVE-2024-5535

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

(cherry picked from commit 214c724e00d594c3eecf4b740ee7af772f0ee04a)

13 months agoAdd explicit testing of ALN and NPN in sslapitest
Matt Caswell [Fri, 21 Jun 2024 09:09:41 +0000 (10:09 +0100)] 
Add explicit testing of ALN and NPN in sslapitest

We already had some tests elsewhere - but this extends that testing with
additional tests.

Follow on from CVE-2024-5535

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

(cherry picked from commit de71058567b84c6e14b758a383e1862eb3efb921)

13 months agoAdd ALPN validation in the client
Matt Caswell [Fri, 21 Jun 2024 10:51:54 +0000 (11:51 +0100)] 
Add ALPN validation in the client

The ALPN protocol selected by the server must be one that we originally
advertised. We should verify that it is.

Follow on from CVE-2024-5535

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

(cherry picked from commit 238fa464d6e38aa2c92af70ef9580c74cff512e4)

13 months agoCorrect return values for tls_construct_stoc_next_proto_neg
Matt Caswell [Fri, 21 Jun 2024 09:41:55 +0000 (10:41 +0100)] 
Correct return values for tls_construct_stoc_next_proto_neg

Return EXT_RETURN_NOT_SENT in the event that we don't send the extension,
rather than EXT_RETURN_SENT. This actually makes no difference at all to
the current control flow since this return value is ignored in this case
anyway. But lets make it correct anyway.

Follow on from CVE-2024-5535

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

(cherry picked from commit e10a3a84bf73a3e6024c338b51f2fb4e78a3dee9)

13 months agoAllow an empty NPN/ALPN protocol list in the tests
Matt Caswell [Tue, 4 Jun 2024 14:47:32 +0000 (15:47 +0100)] 
Allow an empty NPN/ALPN protocol list in the tests

Allow ourselves to configure an empty NPN/ALPN protocol list and test what
happens if we do.

Follow on from CVE-2024-5535

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

(cherry picked from commit 9925c97a8e8c9887765a0979c35b516bc8c3af85)

13 months agoAdd a test for SSL_select_next_proto
Matt Caswell [Fri, 31 May 2024 15:35:16 +0000 (16:35 +0100)] 
Add a test for SSL_select_next_proto

Follow on from CVE-2024-5535

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

(cherry picked from commit 0d883f6309b6905d29ffded6d703ded39385579c)

13 months agoClarify the SSL_select_next_proto() documentation
Matt Caswell [Fri, 31 May 2024 10:46:38 +0000 (11:46 +0100)] 
Clarify the SSL_select_next_proto() documentation

We clarify the input preconditions and the expected behaviour in the event
of no overlap.

Follow on from CVE-2024-5535

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

(cherry picked from commit a210f580f450bbd08fac85f06e27107b8c580f9b)

13 months agoUse correctly formatted ALPN data in tserver
Matt Caswell [Fri, 31 May 2024 10:22:13 +0000 (11:22 +0100)] 
Use correctly formatted ALPN data in tserver

The QUIC test server was using incorrectly formatted ALPN data. With the
previous implementation of SSL_select_next_proto this went unnoticed. With
the new stricter implemenation it was failing.

Follow on from CVE-2024-5535

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

(cherry picked from commit fc8ff75814767d6c55ea78d05adc72cd346d0f0a)

13 months agoMore correctly handle a selected_len of 0 when processing NPN
Matt Caswell [Fri, 31 May 2024 10:18:27 +0000 (11:18 +0100)] 
More correctly handle a selected_len of 0 when processing NPN

In the case where the NPN callback returns with SSL_TLEXT_ERR_OK, but
the selected_len is 0 we should fail. Previously this would fail with an
internal_error alert because calling OPENSSL_malloc(selected_len) will
return NULL when selected_len is 0. We make this error detection more
explicit and return a handshake failure alert.

Follow on from CVE-2024-5535

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

(cherry picked from commit c6e1ea223510bb7104bf0c41c0c45eda5a16b718)

13 months agoFix SSL_select_next_proto
Matt Caswell [Fri, 31 May 2024 10:14:33 +0000 (11:14 +0100)] 
Fix SSL_select_next_proto

Ensure that the provided client list is non-NULL and starts with a valid
entry. When called from the ALPN callback the client list should already
have been validated by OpenSSL so this should not cause a problem. When
called from the NPN callback the client list is locally configured and
will not have already been validated. Therefore SSL_select_next_proto
should not assume that it is correctly formatted.

We implement stricter checking of the client protocol list. We also do the
same for the server list while we are about it.

CVE-2024-5535

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

(cherry picked from commit 2ebbe2d7ca8551c4cb5fbb391ab9af411708090e)

13 months agoevp_pkey_ctx_setget_params_to_ctrl(): Always properly set ctx.action_type
Tomas Mraz [Mon, 24 Jun 2024 09:25:12 +0000 (11:25 +0200)] 
evp_pkey_ctx_setget_params_to_ctrl(): Always properly set ctx.action_type

Fixes #24698

Some applicable translations are bidirectional so they have
NONE action_type. However we need to set the real action_type
in the ctx.

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

(cherry picked from commit 55c1458303c0fef88e4b2b35a090e9145f3e07eb)

13 months agoAdapt all the exporter files to the new vars from util/mkinstallvars.pl
Richard Levitte [Thu, 20 Jun 2024 12:33:15 +0000 (14:33 +0200)] 
Adapt all the exporter files to the new vars from util/mkinstallvars.pl

With this, the pkg-config files take better advantage of relative directory
values.

Fixes #24298

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

(cherry picked from commit 30dc37d798a0428fd477d3763086e7e97b3d596f)

13 months agoGive util/mkinstallvars.pl more fine grained control over var dependencies
Richard Levitte [Thu, 20 Jun 2024 12:30:16 +0000 (14:30 +0200)] 
Give util/mkinstallvars.pl more fine grained control over var dependencies

Essentially, we try to do what GNU does.  'prefix' is used to define the
defaults for 'exec_prefix' and 'libdir', and these are then used to define
further directory values.  util/mkinstallvars.pl is changed to reflect that
to the best of our ability.

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

(cherry picked from commit 6e0fd246e7a6e51f92b2ef3520bfc4414b7773c0)

13 months agobio_ssl.c: Do not call SSL_shutdown if not inited
erbsland-dev [Sat, 22 Jun 2024 07:14:25 +0000 (09:14 +0200)] 
bio_ssl.c: Do not call SSL_shutdown if not inited

Fixes #4545

If free is called for an SSL BIO that is in initialization phase,
the `SSL_shutdown` call is omitted.

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

(cherry picked from commit 57b83edc46926662491d63666231ba7ddc954a38)

13 months agoFix usage of deallocated EVP_RAND_CTX after execution of FIPS on-demand self tests
Karol Brzuskiewicz [Mon, 10 Jun 2024 08:48:31 +0000 (01:48 -0700)] 
Fix usage of deallocated EVP_RAND_CTX after execution of FIPS on-demand self tests

Once RNG is used, triggering FIPS on-demand self tests (via
OSSL_PROVIDER_self_test() API) crashes the application. This happens because the
RNG context is stored before self tests, and restored after their execution.
In the meantime - before context restoration - RAND_set0_private() function is
called, which decrements the stored RNG context reference counter and frees it.
To resolve the issue, the stored RNG context refcount has been incremented via
the EVP_RAND_CTX_up_ref() API to avoid its deallocation during the RNG context
switch performed by the self test function.
The provider_status_test test has been updated to reproduce the issue as
a regression test.

Signed-off-by: Karol Brzuskiewicz <kabr@arista.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24599)

(cherry picked from commit 42a8ef844e5fca55abb608beb62695abe80c6b6d)

13 months agoAllow calling OPENSSL_INIT_free() with NULL argument
Tomas Mraz [Wed, 19 Jun 2024 15:40:21 +0000 (17:40 +0200)] 
Allow calling OPENSSL_INIT_free() with NULL argument

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

(cherry picked from commit d38f62ea118170fc40e10f6f95b180cccbaa7581)

13 months agoAdd Provider compatibility on PR CI job
Tomas Mraz [Fri, 31 May 2024 12:59:21 +0000 (14:59 +0200)] 
Add Provider compatibility on PR CI job

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

(cherry picked from commit 94567d6889b8b48ac618cd8a90911e6732d0e4df)

13 months ago[DOCS] Correct history in doc/man3/OSSL_STORE_LOADER.pod
Richard Levitte [Wed, 19 Jun 2024 06:06:45 +0000 (08:06 +0200)] 
[DOCS] Correct history in doc/man3/OSSL_STORE_LOADER.pod

Bulk editing had history wrongly specify current functions as deprecated,
among other small errors.

Fixes #24678

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

(cherry picked from commit b23cd39f0a4e3cfe142694402a5246a498a3574f)

13 months agoFix regression of EVP_PKEY_CTX_add1_hkdf_info() with older providers
Tomas Mraz [Mon, 17 Jun 2024 14:48:26 +0000 (16:48 +0200)] 
Fix regression of EVP_PKEY_CTX_add1_hkdf_info() with older providers

If there is no get_ctx_params() implemented in the key exchange
provider implementation the fallback will not work. Instead
check the gettable_ctx_params() to see if the fallback should be
performed.

Fixes #24611

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

(cherry picked from commit 663dbc9c9c897392a9f9d18aa9a8400ca024dc5d)

13 months agoIncorporate more review feedback
Robert Schulze [Wed, 19 Jun 2024 08:40:16 +0000 (08:40 +0000)] 
Incorporate more review feedback

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

(cherry picked from commit af82623d32962b3eff5b0f0b0dedec5eb730b231)

13 months agoIncorporate review feedback
Robert Schulze [Tue, 18 Jun 2024 20:31:14 +0000 (20:31 +0000)] 
Incorporate review feedback

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

(cherry picked from commit 8d934a75929d058bbc4566a6ebc9f804e1dd081f)

13 months agoFix data race between SSL_SESSION_list_add and ssl_session_dup
Robert Schulze [Tue, 18 Jun 2024 14:43:26 +0000 (14:43 +0000)] 
Fix data race between SSL_SESSION_list_add and ssl_session_dup

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

(cherry picked from commit 79886c85b378d73aec4d96f8e258f12915faddf7)

13 months agoAdd test for ASN1_item_verify()
Tomas Mraz [Mon, 17 Jun 2024 10:19:45 +0000 (12:19 +0200)] 
Add test for ASN1_item_verify()

This is a test for https://github.com/openssl/openssl/issues/24575
Original idea by Theo Buehler.

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

(cherry picked from commit 2f0b4974dfbd9bc71e1164e0742fc7fdb2b2b70e)

13 months agoASN1_item_verify_ctx(): Return -1 on fatal errors
Tomas Mraz [Thu, 6 Jun 2024 13:36:00 +0000 (15:36 +0200)] 
ASN1_item_verify_ctx(): Return -1 on fatal errors

Fixes #24575

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

(cherry picked from commit 8d380f85da215012570347f156e642d69909877a)

13 months agoAdd CHANGES.md entry for the EC/DSA nonce generation fixes
Tomas Mraz [Mon, 17 Jun 2024 10:35:39 +0000 (12:35 +0200)] 
Add CHANGES.md entry for the EC/DSA nonce generation fixes

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

13 months agoSome minor nit corrections in the thread code for rcu
Neil Horman [Mon, 17 Jun 2024 18:12:46 +0000 (14:12 -0400)] 
Some minor nit corrections in the thread code for rcu

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

13 months agoMake rcu_thread_key context-aware
Neil Horman [Mon, 15 Apr 2024 20:56:29 +0000 (16:56 -0400)] 
Make rcu_thread_key context-aware

Currently, rcu has a global bit of data, the CRYPTO_THREAD_LOCAL object
to store per thread data.  This works in some cases, but fails in FIPS,
becuase it contains its own copy of the global key.

So
1) Make the rcu_thr_key a per-context variable, and force
   ossl_rcu_lock_new to be context aware

2) Store a pointer to the context in the lock object

3) Use the context to get the global thread key on read/write lock

4) Use ossl_thread_start_init to properly register a cleanup on thread
   exit

5) Fix up missed calls to OSSL_thread_stop() in our tests

(cherry picked from commit 24d16d3a1915a06a2130385a87de9a37fc09c4b9)

Fixes #24581

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

13 months agoFix handling of max_fragment_length extension for PSK
Frederik Wedel-Heinen [Tue, 28 May 2024 11:59:44 +0000 (13:59 +0200)] 
Fix handling of max_fragment_length extension for PSK

A psk session was assumed to be a resumption which failed a check
when parsing the max_fragment_length extension hello from the client.

Relevant code from PR#18130 which was a suggested fix to the issue
was cherry-picked.

Fixes #18121

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

(cherry picked from commit fa495604516a610d988f02298c8d97a6ac4777bb)

13 months agodocs: fix SSL_CTX_set_tlsext_ticket_key_cb typos
Daniel McCarney [Mon, 17 Jun 2024 20:53:50 +0000 (16:53 -0400)] 
docs: fix SSL_CTX_set_tlsext_ticket_key_cb typos

* "shortcuts the TLS" -> "shortcuts the TLS handshake"
* "don't occur" -> "doesn't occur"
* "storing client certificate" -> "storing the client certificate"
* "an all other" -> "and all other"

CLA: trivial

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

(cherry picked from commit e2a4d68a03b8a3576b0fe917a602b3a283d105a5)

13 months agoossl_store.pod: Correct the example of OSSL_STORE API usage
Et7f3 [Sat, 6 Apr 2024 19:09:30 +0000 (21:09 +0200)] 
ossl_store.pod: Correct the example of OSSL_STORE API usage

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

(cherry picked from commit d5412c94a399d3923b2dec2431ead60288d857c8)

13 months agoFix typo in openssl-verification-options documentation.
Jaime Hablutzel [Mon, 17 Jun 2024 16:40:08 +0000 (11:40 -0500)] 
Fix typo in openssl-verification-options documentation.

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24662)

(cherry picked from commit f159d861e2761ffc6421b0486fdd482f37215f9f)

13 months agoCMP app: fix combination of -certout and -chainout with equal filename argument
Dr. David von Oheimb [Thu, 25 Apr 2024 18:05:22 +0000 (20:05 +0200)] 
CMP app: fix combination of -certout and -chainout with equal filename argument

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

(cherry picked from commit 5aec3f4a72604d76970581f1ea445b331beda608)

13 months agofix potential memory leak in PKCS12_add_key_ex()
sashan [Wed, 22 May 2024 07:16:49 +0000 (09:16 +0200)] 
fix potential memory leak in PKCS12_add_key_ex()

function must make sure memorry allocated for `p8`
gets freed in error path. Issue reported by LuMingYinDetect

Fixes #24453

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

13 months agoOSSL_CMP_{validate_msg,CTX_new}.pod: add warning notes on OSSL_CMP_OPT_PERMIT_TA_IN_E...
Dr. David von Oheimb [Mon, 11 Mar 2024 12:06:13 +0000 (13:06 +0100)] 
OSSL_CMP_{validate_msg,CTX_new}.pod: add warning notes on OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR

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

(cherry picked from commit 40948c4c74099ae21843d9265dfe65f13cb9e6c5)

13 months agoOSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR...
Dr. David von Oheimb [Mon, 11 Mar 2024 11:48:26 +0000 (12:48 +0100)] 
OSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR becomes usable again

Fixes #23706

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

(cherry picked from commit b893ceef2feb6b64504446f984ee5a57d2b69d1f)

13 months ago80-test_cmp_http_data/test_connection.csv: disable localhost test as not supported...
Dr. David von Oheimb [Wed, 6 Mar 2024 08:48:30 +0000 (09:48 +0100)] 
80-test_cmp_http_data/test_connection.csv: disable localhost test as not supported on some hosts

Fixes #22870

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

(cherry picked from commit f8acb534e41450d3e113e338caed8b15d4a3d5e6)

13 months agoConfigure: make absolutedir() use rel2abs() on Windows too
Richard Levitte [Wed, 5 Jun 2024 19:43:01 +0000 (21:43 +0200)] 
Configure: make absolutedir() use rel2abs() on Windows too

perl's realpath() seems to be buggy on Windows, so we turn to rel2abs()
there as well.

Fixes #23593

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

(cherry picked from commit 6e01d3114b77c82cf83a2bfe53f7ba97840fbe36)

13 months agoFix memory leak in quic_trace.c
Amir Mohammadi [Wed, 5 Jun 2024 18:56:19 +0000 (22:26 +0330)] 
Fix memory leak in quic_trace.c

Fixes #24340

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24568)

(cherry picked from commit 1977c00f00ad0546421a5ec0b40c1326aee4cddb)

14 months ago[Docs] Notes about freeing objects
Ruslan Baratov [Thu, 23 May 2024 14:03:12 +0000 (22:03 +0800)] 
[Docs] Notes about freeing objects

- Free objects returned from PEM read
- Free objects returned from d2i_*

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

(cherry picked from commit d4700c0b237c05315e3bf14fc416abcbdfe51ff2)

14 months agotest/prov_config_test.c: Cleanup and fix potential leaks
Tomas Mraz [Thu, 11 Apr 2024 09:34:57 +0000 (11:34 +0200)] 
test/prov_config_test.c: Cleanup and fix potential leaks

Fixes #24106

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

(cherry picked from commit 140540189c67ba94188165b1144fdfb5b248bc02)

14 months agoDrop the old PGP key fingerprint
Richard Levitte [Wed, 5 Jun 2024 08:22:22 +0000 (10:22 +0200)] 
Drop the old PGP key fingerprint

All public releases have the information of the new PGP key in
doc/fingerprints.txt, so it is finally time to drop the old.

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

(cherry picked from commit a9fa07f47cea6a43d5ac4a3aa336ab34756c2e9b)

14 months agoFix memory leak on error in crypto/conf/conf_mod.c
shridhar kalavagunta [Fri, 12 Apr 2024 01:42:37 +0000 (20:42 -0500)] 
Fix memory leak on error in crypto/conf/conf_mod.c

Fixes #24111

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

(cherry picked from commit 5bbdbce856c7ca132e039a24a315618484874c81)

14 months agoenable AES-XTS optimization for AIX
sanumesh [Tue, 28 May 2024 17:46:52 +0000 (12:46 -0500)] 
enable AES-XTS optimization for AIX

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

(cherry picked from commit dda1635cbff44d8d1b41a08e53c936ccb6c41acd)

14 months agoPrepare for 3.3.2 24556/head
Tomas Mraz [Tue, 4 Jun 2024 12:53:39 +0000 (14:53 +0200)] 
Prepare for 3.3.2

Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

14 months agoPrepare for release of 3.3.1 openssl-3.3.1
Tomas Mraz [Tue, 4 Jun 2024 12:53:04 +0000 (14:53 +0200)] 
Prepare for release of 3.3.1

Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

14 months agomake update
Tomas Mraz [Tue, 4 Jun 2024 12:53:01 +0000 (14:53 +0200)] 
make update

Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

14 months agoCopyright year updates
Tomas Mraz [Tue, 4 Jun 2024 12:50:58 +0000 (14:50 +0200)] 
Copyright year updates

Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

14 months agoDisable 70-test_quic_multistream.t when building with PUT threads.
Randall S. Becker [Wed, 22 May 2024 23:34:45 +0000 (23:34 +0000)] 
Disable 70-test_quic_multistream.t when building with PUT threads.

The test recipe includes a TEST_skip when OpenSSL is built with _PUT_MODEL_
based on design assumptions for QUIC and incompatibility with PUT wrapper
methods.

Fixes: #24442
Fixes: #24431
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24468)

(cherry picked from commit 0e2567d7293d3204de66acca0ed55bda4f0c0768)

14 months agoUpdate CHANGES.md and NEWS.md for the upcoming release
Tomas Mraz [Mon, 3 Jun 2024 14:46:41 +0000 (16:46 +0200)] 
Update CHANGES.md and NEWS.md for the upcoming release

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

14 months ago[Docs] SSL_*_use will increment reference counter
Ruslan Baratov [Wed, 29 May 2024 00:36:53 +0000 (08:36 +0800)] 
[Docs] SSL_*_use will increment reference counter

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

(cherry picked from commit 0c73d65eeae9086c37149f4a512946040c8c2af3)

14 months agocmp_hdr_test.c: Fix leaks in error cases
shridhar kalavagunta [Mon, 27 May 2024 23:43:51 +0000 (18:43 -0500)] 
cmp_hdr_test.c: Fix leaks in error cases

Fixes #24475

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

(cherry picked from commit 0986e128ff258d482cab712aa617a533db5588ea)

14 months agouefi: move variables
Gerd Hoffmann [Wed, 22 May 2024 11:11:09 +0000 (13:11 +0200)] 
uefi: move variables

Fixes "unused variable" warnings with OPENSSL_SYS_UEFI.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24459)

(cherry picked from commit 7bc10f6ce2f91714d39a0410bfc545d79913e343)

14 months agouefi: add typedef for uintptr_t
Gerd Hoffmann [Wed, 22 May 2024 08:18:52 +0000 (10:18 +0200)] 
uefi: add typedef for uintptr_t

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24459)

(cherry picked from commit 7b33501a74ec2db4e54ddcd751dd42ded32bfd5b)

14 months agoVMS: Redefine _XOPEN_SOURCE_EXTENDED with the value 1
Richard Levitte [Thu, 23 May 2024 05:54:27 +0000 (07:54 +0200)] 
VMS: Redefine _XOPEN_SOURCE_EXTENDED with the value 1

Some versions if the VMS C system header files seem to require this.

Fixes #24466

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

(cherry picked from commit f6b307d860832d3a76be20a693b92a71c83a3055)

14 months agoFix potential memory leak in test_bad_dtls
Amir Mohammadi [Wed, 22 May 2024 16:18:51 +0000 (19:48 +0330)] 
Fix potential memory leak in test_bad_dtls

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

(cherry picked from commit abe05fda8bdbfb35de7420cab31d5e459fabc874)

14 months agoUpdate configurable sigalgs documentation for providers
Michael Baentsch [Mon, 27 May 2024 06:12:31 +0000 (08:12 +0200)] 
Update configurable sigalgs documentation for providers

also adding to SignatureAlgorithms section

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/24499)

(cherry picked from commit 90e7c12f1b238ed714786fafc26d05b59a63752b)

14 months agothreads_pthread.c: change inline to ossl_inline
sanumesh [Mon, 27 May 2024 10:00:00 +0000 (05:00 -0500)] 
threads_pthread.c: change inline to ossl_inline

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

(cherry picked from commit 36ba419286843bcaeb497b3451540ab7587cf9d2)

14 months agoecstresstest.c: Fix memory leak on error
Nek Saikou [Fri, 24 May 2024 10:45:01 +0000 (17:45 +0700)] 
ecstresstest.c: Fix memory leak on error

Fixes #24476
CLA: trivial

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

(cherry picked from commit 434e7f7cb4259f8c8c1463fd38fe723b3efca887)

14 months agoFurther extend the SSL_free_buffers testing
Matt Caswell [Fri, 26 Apr 2024 12:58:29 +0000 (13:58 +0100)] 
Further extend the SSL_free_buffers testing

We extend the testing to test what happens when pipelining is in use.

Follow on from CVE-2024-4741

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

(cherry picked from commit c1bd38a003fa19fd0d8ade85e1bbc20d8ae59dab)

14 months agoMove the ability to load the dasync engine into ssltestlib.c
Matt Caswell [Fri, 26 Apr 2024 10:05:52 +0000 (11:05 +0100)] 
Move the ability to load the dasync engine into ssltestlib.c

The sslapitest has a helper function to load the dasync engine which is
useful for testing pipelining. We would like to have the same facility
from sslbuffertest, so we move the function to the common location
ssltestlib.c

Follow on from CVE-2024-4741

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

(cherry picked from commit 05752478df623a9ddf849f897b630c1e0728cb7c)

14 months agoExtend the SSL_free_buffers testing
Matt Caswell [Thu, 25 Apr 2024 08:34:16 +0000 (09:34 +0100)] 
Extend the SSL_free_buffers testing

Test that attempting to free the buffers at points where they should not
be freed works as expected.

Follow on from CVE-2024-4741

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

(cherry picked from commit 566f3069169b9fab4fbb23da98c3c91730dd5209)

14 months agoSet rl->packet to NULL after we've finished using it
Matt Caswell [Tue, 23 Apr 2024 15:36:11 +0000 (16:36 +0100)] 
Set rl->packet to NULL after we've finished using it

In order to ensure we do not have a UAF we reset the rl->packet pointer
to NULL after we free it.

Follow on from CVE-2024-4741

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

(cherry picked from commit bfb8128190632092b3a66465838b87b469455cec)

14 months agoOnly free the read buffers if we're not using them
Matt Caswell [Tue, 23 Apr 2024 15:34:46 +0000 (16:34 +0100)] 
Only free the read buffers if we're not using them

If we're part way through processing a record, or the application has
not released all the records then we should not free our buffer because
they are still needed.

CVE-2024-4741

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

(cherry picked from commit 38690cab18de88198f46478565fab423cf534efa)

14 months agoAdded an explicit yield (OP_SLEEP) to QUIC testing for cooperative threading.
Randall S. Becker [Mon, 20 May 2024 22:23:04 +0000 (22:23 +0000)] 
Added an explicit yield (OP_SLEEP) to QUIC testing for cooperative threading.

Fixes: #24442
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24443)

(cherry picked from commit b9e084f139c53ce133e66aba2f523c680141c0e6)

14 months ago[Docs] Default value for verification flags is 'SSL_VERIFY_NONE'
Ruslan Baratov [Sat, 18 May 2024 15:34:19 +0000 (23:34 +0800)] 
[Docs] Default value for verification flags is 'SSL_VERIFY_NONE'

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

(cherry picked from commit a73e07dbb7df4795c4ec537f19516b541fb8dd3c)

14 months agofips provider: explicitly setup cpuid when initializing
Hongren Zheng [Thu, 16 May 2024 08:41:25 +0000 (16:41 +0800)] 
fips provider: explicitly setup cpuid when initializing

Fixes: #23979
Previously fips module relied on OPENSSL_cpuid_setup
being used as constructor by the linker to correctly
setup the capability vector, either via .section .init
(for x86_64) or via __attribute__((constructor)).

This would make ld.so call OPENSSL_cpuid_setup before
the init function for fips module. However, this early
constructing behavior has several disadvantages:

1. Not all platform/toolchain supports such behavior

2. Initialisation sequence is not well defined, and
some function might not be initialized when cpuid_setup
is called

3. Implicit path is hard to maintain and debug

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

(cherry picked from commit a192b2439c0207ce1b04ba6137329b68f9e23680)

14 months agoFix mem leak in threadpool_test.c
shridhar kalavagunta [Tue, 30 Apr 2024 01:59:57 +0000 (20:59 -0500)] 
Fix mem leak in threadpool_test.c

Fixes #24104

Added a goto label for cleanup.

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

(cherry picked from commit 4dbd4925dfc61d93df678df607504f62b0ac3dcc)

14 months agoFix typo in CONTRIBUTING.md
James Muir [Thu, 16 May 2024 02:07:58 +0000 (22:07 -0400)] 
Fix typo in CONTRIBUTING.md

CLA: trivial

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

(cherry picked from commit 45f5d51b72a262bf85c4461fbded91485ce6b9da)

14 months agoCheck DSA parameters for excessive sizes before validating
Tomas Mraz [Wed, 8 May 2024 13:23:45 +0000 (15:23 +0200)] 
Check DSA parameters for excessive sizes before validating

This avoids overly long computation of various validation
checks.

Fixes CVE-2024-4603

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

(cherry picked from commit 85ccbab216da245cf9a6503dd327072f21950d9b)

14 months agoUpdate openssl-smime.pod.in
DominikN [Fri, 5 Apr 2024 21:06:41 +0000 (23:06 +0200)] 
Update openssl-smime.pod.in

Remove duplicate entries for -nocerts and -noattr

CLA:trivial

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

(cherry picked from commit 5a0c92cf093b4f0aa65f4fdbff88d7bdc83491f3)

14 months ago[Docs] 'SSL_CTX_set_cert_store' ownership of 'store'
Ruslan Baratov [Sun, 12 May 2024 08:33:59 +0000 (16:33 +0800)] 
[Docs] 'SSL_CTX_set_cert_store' ownership of 'store'

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

(cherry picked from commit 987baef4fa54d268d7eaa93837a56398409698a1)

14 months agofix sm2 encryption implementation bug.
Liu-Ermeng [Mon, 8 Jan 2024 04:01:29 +0000 (20:01 -0800)] 
fix sm2 encryption implementation bug.

According to the "GB/T 32918.4-2016"
section 6.1 encryption, step A5:
If result of the "KDF" is all zeros, we should go back to
the begin(step A1).

section 7.1 decryption, step B4:
If result of the "KDF" is all zeros, we should raise error and exit.

Signed-off-by: Liu-Ermeng <liuermeng2@huawei.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23210)

(cherry picked from commit 170620675dfd74f34bdcf8aba71dffeb07f3d533)

14 months agosslapitest.c: With fips skip tests depending on X25519 and X448
Tomas Mraz [Thu, 9 May 2024 08:48:56 +0000 (10:48 +0200)] 
sslapitest.c: With fips skip tests depending on X25519 and X448

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

(cherry picked from commit f6e469808501f52c7e8f8679d6c3290cf1c258b3)

14 months ago90-test_sslapi.t: Fix execution of sslapitest with fips provider
Tomas Mraz [Fri, 10 May 2024 12:50:46 +0000 (14:50 +0200)] 
90-test_sslapi.t: Fix execution of sslapitest with fips provider

Default configuration of the fips provider for tests is pedantic
which means that sslapitest was not fully executed with fips provider.

The ems check must be switched off for full execution.

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

(cherry picked from commit d2af5e4c946afb59d3512b440642f0da775d198f)

14 months agotest/ssl-tests: Avoid depending on X25519 and X448 being fips approved
Tomas Mraz [Wed, 17 Apr 2024 16:05:35 +0000 (18:05 +0200)] 
test/ssl-tests: Avoid depending on X25519 and X448 being fips approved

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

14 months agoquicapitest.c: Make test_ssl_trace to be insensitive to fips changes
Tomas Mraz [Wed, 8 May 2024 14:13:30 +0000 (16:13 +0200)] 
quicapitest.c: Make test_ssl_trace to be insensitive to fips changes

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

14 months agoRelease pkey_ctx on initialization failure
irosay [Fri, 10 May 2024 16:37:52 +0000 (17:37 +0100)] 
Release pkey_ctx on initialization failure

CLA: trivial

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

(cherry picked from commit 3e9d933882407a0792dc3466ba9a0d53d40677a7)

14 months agoapps/pkcs12: Not writing the private key file until the import password is verified
naaysayer [Sat, 2 Mar 2024 09:35:35 +0000 (13:35 +0400)] 
apps/pkcs12: Not writing the private key file until the import password is verified

Fixes #904

CLA: trivial

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

(cherry picked from commit f5462572a1873482ce38646cbf00dfc483f02068)

14 months agoAdd reason codes with the correct offset for two alerts
Jacob Champion [Mon, 6 May 2024 16:50:11 +0000 (09:50 -0700)] 
Add reason codes with the correct offset for two alerts

Fixes #24300. The current values of SSL_R_NO_APPLICATION_PROTOCOL and
SSL_R_PSK_IDENTITY_NOT_FOUND don't allow for a correct lookup of the
corresponding reason strings.

CLA: trivial

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

(cherry picked from commit a401aaf9ed6eb34842cdedfcc35448bdc4174df3)

14 months agothreads_win: fix build error with VS2010
Georgi Valkov [Fri, 3 May 2024 04:51:08 +0000 (07:51 +0300)] 
threads_win: fix build error with VS2010

VC 2010 or earlier compilers do not support static inline.
To work around this problem, we can use the ossl_inline macro.

Fixes:
crypto\threads_win.c(171) : error C2054: expected '(' to follow 'inline'
crypto\threads_win.c(172) : error C2085: 'get_hold_current_qp' : not in formal parameter list
crypto\threads_win.c(172) : error C2143: syntax error : missing ';' before '{'
crypto\threads_win.c(228) : warning C4013: 'get_hold_current_qp' undefined; assuming extern returning int
crypto\threads_win.c(228) : warning C4047: '=' : 'rcu_qp *' differs in levels of indirection from 'int'

Signed-off-by: Georgi Valkov <gvalkov@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/24370)

(cherry picked from commit d8dd1dfdf5cf2343f6afd43dad4ce37045218624)

14 months agodoc: Fix description of EVP_CIPHER_CTX_dup
Daiki Ueno [Mon, 13 May 2024 00:07:57 +0000 (09:07 +0900)] 
doc: Fix description of EVP_CIPHER_CTX_dup

This fixes a couple of copy and paste error from EVP_MD_CTX_dup,
where: EVP_CIPHER_CTX_dup is useful to avoid multiple
EVP_CIPHER_fetch (instead of EVP_MD_fetch) and returns
EVP_CIPHER_CTX (instead of EVP_MD_CTX).

Signed-off-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24376)

(cherry picked from commit 7860bca22c404cfd763ae2648d708d5cc4df6c2f)

14 months agoquic_multistream_test: fix undefined symbol snprintf with VS2010
Georgi Valkov [Sat, 4 May 2024 08:24:08 +0000 (11:24 +0300)] 
quic_multistream_test: fix undefined symbol snprintf with VS2010

As snprintf is not available everywhere, use BIO_snprintf instead.

Fixes:
        IF EXIST test\quic_multistream_test.exe.manifest DEL /F /Q test\quic_multistream_test.exe.manifest
        "link" /nologo /debug setargv.obj /subsystem:console /opt:ref  /nologo /debug @V:\_tmp\nm4.tmp
quic_multistream_test-bin-quic_multistream_test.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _helper_init
test\quic_multistream_test.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"E:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
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/24369)

(cherry picked from commit c02f952b48927af9fc4e991d7ead89a4cd1636bc)

14 months agoImplement riscv_vlen_asm for riscv32
Hongren Zheng [Fri, 26 Apr 2024 06:03:43 +0000 (06:03 +0000)] 
Implement riscv_vlen_asm for riscv32

riscvcap.c: undefined reference to 'riscv_vlen_asm'

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

(cherry picked from commit 87314d24c4f025df1ebf47dc527cc8a96bef354a)

14 months agotls_provider_init(): Rename prov_ctx to xor_prov_ctx to clarify
Tomas Mraz [Fri, 12 Apr 2024 09:16:17 +0000 (11:16 +0200)] 
tls_provider_init(): Rename prov_ctx to xor_prov_ctx to clarify

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

(cherry picked from commit 3de3d481b269e9831d0b9abd3598b262647ae050)

14 months agotls_provider_init(): Fix leaks in error cases
Tomas Mraz [Thu, 11 Apr 2024 08:05:04 +0000 (10:05 +0200)] 
tls_provider_init(): Fix leaks in error cases

Fixes #24101

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

(cherry picked from commit 2a5d733e64f009f758163da852f1e7fee6aea0a2)

14 months agoDependabot update: Bump coverallsapp/github-action
dependabot[bot] [Wed, 8 May 2024 17:11:38 +0000 (17:11 +0000)] 
Dependabot update: Bump coverallsapp/github-action

CLA: trivial

(deps): Bump coverallsapp/github-action

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/v2.2.3...v2.3.0)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24350)

(cherry picked from commit 13d37d8f7557ee7935032ea832eab3e3c5540158)

15 months agoAvoid memory leak in x509_test error path
Viktor Dukhovni [Wed, 27 Mar 2024 22:15:29 +0000 (18:15 -0400)] 
Avoid memory leak in x509_test error path

Fixes #23897

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

(cherry picked from commit 7cbca5a6d6e792c75c414e1f3fb22e2afae67988)

15 months agoAdd linux-arm64ilp32-clang target
Huiyue Xu [Thu, 9 Nov 2023 02:54:02 +0000 (10:54 +0800)] 
Add linux-arm64ilp32-clang target

While clang 15 config target by '--target', not cannot support
'-mabi=ilp32', so add the linux-arm64ilp32-clang target.

Signed-off-by: Huiyue Xu <xuhuiyue@huawei.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22666)

(cherry picked from commit 69bd5e4fff8ac9bf4dc3ed6fd87b5a5858edbb01)