]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
12 months agoUnlock only when lock was successful 24646/head
cchinchole [Tue, 2 Jul 2024 01:16:03 +0000 (20:16 -0500)] 
Unlock only when lock was successful

Addressing issue (#24517):
Updated the example in CRYPTO_THREAD_run_once.pod to reflect that an unlock call should not be made if a write_lock failed.
Updated BIO_lookup_ex in bio_addr.c and ossl_engine_table_select in eng_table.c to not call unlock if the lock failed.

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

12 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)

12 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)

(cherry picked from commit 3d9c6b16d8b8e75b73e2fd34849e930e2792f3a4)

12 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)

12 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)

12 months agoConvert hashtable to using ossl_rcu_deref on lookup
Neil Horman [Wed, 19 Jun 2024 21:53:58 +0000 (17:53 -0400)] 
Convert hashtable to using ossl_rcu_deref on lookup

The new hashtable has an issue on non-64 bit builds.  We use
CRYPTO_atomic_load to load a pointer value when doing lookups, but that
API relies on the expectation that pointers are 64 bits wide.  On 32 bit
systems, we try to load 64 bits using CRYPTO_atomic_load into a 32 bit
pointer, which overruns our stack

Fix this by no longer using CRYPTO_atomic_load for value fetches from
the hashtable.  Instead use ossl_rcu_deref, whcih operates on void
pointers and is safe on all arches

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

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)

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)

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)

13 months agothreads_win: fix build error with VS2010 x86
Georgi Valkov [Fri, 28 Jun 2024 05:16:10 +0000 (08:16 +0300)] 
threads_win: fix build error with VS2010 x86

InterlockedAnd64 and InterlockedAdd64 are not available on VS2010 x86.
We already have implemented replacements for other functions, such as
InterlockedOr64. Apply the same approach to fix the errors.
A CRYPTO_RWLOCK rw_lock is added to rcu_lock_st.

Replace InterlockedOr64 and InterlockedOr with CRYPTO_atomic_load and
CRYPTO_atomic_load_int, using the existing design pattern.

Add documentation and tests for the new atomic functions
CRYPTO_atomic_add64, CRYPTO_atomic_and

Fixes:
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAdd64 referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAnd64 referenced in function _update_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr64 referenced in function _ossl_synchronize_rcu

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24405)

13 months agoAdd badges for daily checks and provider compat
Neil Horman [Fri, 28 Jun 2024 17:17:41 +0000 (13:17 -0400)] 
Add badges for daily checks and provider compat

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

13 months agoRemove appveyor badge and replace it with os zoo badge
Neil Horman [Fri, 28 Jun 2024 11:04:43 +0000 (07:04 -0400)] 
Remove appveyor badge and replace it with os zoo badge

We don't use appveyor anymore. Replace it with the os zoo badge, so we
can more persistently see when its breaking

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

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)

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)

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)

13 months agoRemove macos-11 from CI
Neil Horman [Wed, 26 Jun 2024 20:24:48 +0000 (16:24 -0400)] 
Remove macos-11 from CI

Recent build failure on os-zoo reports:
A brownout will take place on June, 8:00 AM – 2:00 PM EST to raise awareness of the upcoming macOS-11 environment removal.

It appears that github is retiring macos-11, so we may as well remove it
to prepare

Fixes #24739

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24744)

13 months agoDisable default case checks on clang 18
Neil Horman [Wed, 26 Jun 2024 20:23:04 +0000 (16:23 -0400)] 
Disable default case checks on clang 18

Recent updates in CI have upgraded clang to clang-18, which gripes when
it finds a switch statement without a default case.  We should add those
cases in, but since we have a lot of those, and CI is currently failing,
disable the check until we get them fixed up

Fixes #24739

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24744)

13 months agoEnable ipv6 use if available
Neil Horman [Wed, 26 Jun 2024 20:20:02 +0000 (16:20 -0400)] 
Enable ipv6 use if available

Recently, it appears alpine containers added ipv6, which breaks our ipv6
ssl old tests because the perl test recipie runs the ipv6 test based on
runtime availability, even if the build time selection is to disable
ipv6.

Fix it by modifying the os zoo ci run to enable ipv6 in the build if its
available on the container

Fixes #24739

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24744)

13 months agop12_npas.c: Remove call with unused return value
Drokov Pavel [Fri, 12 Jan 2024 07:32:06 +0000 (02:32 -0500)] 
p12_npas.c: Remove call with unused return value

CLA: trivial

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

13 months agoossl_print_attribute_value(): Multiple minor fixes for style and other errors
Jonathan M. Wilbur [Sat, 22 Jun 2024 19:48:42 +0000 (19:48 +0000)] 
ossl_print_attribute_value(): Multiple minor fixes for style and other errors

- use correct return values
- do not modify pointer in the atrtribute after decoding with d2i_X509_NAME()
- make oid parameter const in print_oid
- use OPENSSL_buf2hexstr_ex
- simplify return code translation from BIO_printf()

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

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

13 months agotest: add tests for acceptable policies exts
Jonathan M. Wilbur [Mon, 24 Jun 2024 20:23:23 +0000 (20:23 +0000)] 
test: add tests for acceptable policies exts

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

13 months agofeat: add acceptablePrivilegePolicies and acceptableCertPolicies exts
Jonathan M. Wilbur [Mon, 17 Jun 2024 18:22:08 +0000 (18:22 +0000)] 
feat: add acceptablePrivilegePolicies and acceptableCertPolicies exts

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

13 months agoMASM: Need to strip arguments after .pdata or .xdata
Kelvin Lee [Mon, 24 Jun 2024 11:09:03 +0000 (21:09 +1000)] 
MASM: Need to strip arguments after .pdata or .xdata

For MASM,

.section .pdata,"r"

got translated to:

.pdata,"r"    SEGMENT READONLY ALIGN(4)

that breaks ml64.
Previous version of x86_64-xlate.pl did strip that ',"r"'.

CLA: trivial

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

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)

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)

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)

13 months agoFix memory leak in x509_req_test
Ingo Franzki [Mon, 24 Jun 2024 11:46:16 +0000 (13:46 +0200)] 
Fix memory leak in x509_req_test

Running the x509_req_test with address sanitizer shows a memory leak:

==186455==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 53 byte(s) in 1 object(s) allocated from:
    #0 0x3ffad5f47af in malloc (/lib64/libasan.so.8+0xf47af) (BuildId: 93b3d2536d76f772a95880d76c746c150daabbee)
    #1 0x3ffac4214fb in CRYPTO_malloc crypto/mem.c:202
    #2 0x3ffac421759 in CRYPTO_zalloc crypto/mem.c:222
    #3 0x100e58f in test_mk_file_path test/testutil/driver.c:450
    #4 0x1004671 in test_x509_req_detect_invalid_version test/x509_req_test.c:32
    #5 0x100d247 in run_tests test/testutil/driver.c:342
    #6 0x10042e3 in main test/testutil/main.c:31
    #7 0x3ffaad34a5b in __libc_start_call_main (/lib64/libc.so.6+0x34a5b) (BuildId: 461b58df774538594b6173825bed67a9247a014d)
    #8 0x3ffaad34b5d in __libc_start_main@GLIBC_2.2 (/lib64/libc.so.6+0x34b5d) (BuildId: 461b58df774538594b6173825bed67a9247a014d)
    #9 0x1004569  (/root/openssl/test/x509_req_test+0x1004569) (BuildId: ab6bce0e531df1e3626a8f506d07f6ad7c7c6d57)
SUMMARY: AddressSanitizer: 53 byte(s) leaked in 1 allocation(s).

The certFilePath that is obtained via test_mk_file_path() must be freed when
no longer used.

While at it, make the certFilePath variable a local variable, there is no need
to have this a global static variable.

Fixes: https://github.com/openssl/openssl/commit/7d2c0a4b1feb152ee1190dfedc65dfd1c928f9e5
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24715)

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)

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)

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)

13 months agostricter parser for ipv4_from_asc
David Benjamin [Mon, 20 May 2024 12:25:17 +0000 (14:25 +0200)] 
stricter parser for ipv4_from_asc

reject invalid IPv4 addresses in ipv4_from_asc

The old scanf-based parser accepted all kinds of invalid inputs like:
"1.2.3.4.5"
"1.2.3.4 "
"1.2.3. 4"
" 1.2.3.4"
"1.2.3.4."
"1.2.3.+4"
"1.2.3.4.example.test"
"1.2.3.01"
"1.2.3.0x1"
Thanks to Amir Mohamadi for pointing this out.

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

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)

13 months agoSupport subjectDirectoryAttributes and associatedInformation exts
Jonathan M. Wilbur [Tue, 18 Jun 2024 09:08:40 +0000 (09:08 +0000)] 
Support subjectDirectoryAttributes and associatedInformation exts

Added tests for SDA and AI extensions.
Added internal function ossl_print_attribute_value() with documentation.

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

13 months agoFix typos found by codespell
Dimitri Papadopoulos [Thu, 20 Jun 2024 18:42:46 +0000 (20:42 +0200)] 
Fix typos found by codespell

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/24691)

13 months agoExtend `mask` of `ssl_method_st` to 64-bit
erbsland-dev [Thu, 20 Jun 2024 18:44:00 +0000 (20:44 +0200)] 
Extend `mask` of `ssl_method_st` to 64-bit

Fixes #23260: The bit count for `SSL_OP_*` flags has exceeded 32 bits, making it impossible to handle newer flags and protocol extensions with the existing 32-bit variables. This commit extends the `mask` field in the `ssl_method_st` structure to 64-bit, aligning them with the previously extended 64-bit `options` field.

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

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)

13 months agoMake x509_req_test ANSI Compatible
erbsland-dev [Wed, 19 Jun 2024 17:09:15 +0000 (19:09 +0200)] 
Make x509_req_test ANSI Compatible

Update the `x509_req_test` to ensure ANSI compatibility. The integrated certificate string was too long, so the PEM certificate has been moved to `certs/x509-req-detect-invalid-version.pem`. The test have been updated to load this certificate from the file on disk.

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

13 months agoAdd Test for Verification Failure on Incorrect X509 Version
erbsland-dev [Wed, 19 Jun 2024 12:02:53 +0000 (14:02 +0200)] 
Add Test for Verification Failure on Incorrect X509 Version

Tests #5738: Introduce a new test to verify that a malformed X509 request with the version field set to version 6 fails either early when reading from data or later when `X509_REQ_verify` is called.
Adding a new test recipe `60-test_x509_req.t`

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

13 months agoAdd Version Check for CSR Verification
erbsland-dev [Wed, 19 Jun 2024 12:02:06 +0000 (14:02 +0200)] 
Add Version Check for CSR Verification

Fixes #5738: This change introduces a check for the version number of a CSR document before its signature is verified. If the version number is not 1 (encoded as zero), the verification function fails with an `X509_R_UNSUPPORTED_VERSION` error.

To minimize impact, this check is only applied when verifying a certificate signing request using the `-verify` argument, resulting in a `X509_REQ_verify` call. This ensures that malformed certificate requests are rejected by a certification authority, enhancing security and preventing potential issues.

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

13 months agos_client: use the full buffer for reads
Hubert Kario [Thu, 20 Jun 2024 15:48:35 +0000 (17:48 +0200)] 
s_client: use the full buffer for reads

Use full allocated buffer for reads to not call into switch() over and
over; also increase the size of the buffer to 16 kiB (max for TLS
records). The server side already is using 16 kiB buffers.

Signed-off-by: Hubert Kario <hkario@redhat.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24688)

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)

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)

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)

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)

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)

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)

13 months agofeat: add delegatedNameConstraints and holderNameConstraints exts
Jonathan M. Wilbur [Mon, 17 Jun 2024 21:40:30 +0000 (21:40 +0000)] 
feat: add delegatedNameConstraints and holderNameConstraints exts

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

13 months agoAdd comp.h to gitignore
Todd Short [Tue, 18 Jun 2024 18:11:15 +0000 (14:11 -0400)] 
Add comp.h to gitignore

Signed-off-by: Todd Short <todd.short@me.com>
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/24676)

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)

(cherry picked from commit 72bff68f6acc4f420e283bcc77db76eb1917d7bf)

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)

(cherry picked from commit d38d2642287ef9a22f20e662a19c217c227043a6)

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)

13 months agoCMP: add support for requesting cert template using genm/genp
Rajeev Ranjan [Wed, 15 May 2024 11:11:09 +0000 (13:11 +0200)] 
CMP: add support for requesting cert template using genm/genp

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

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)

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)

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)

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)

13 months agoMVP demo TLS server
Viktor Dukhovni [Mon, 27 May 2024 11:35:56 +0000 (21:35 +1000)] 
MVP demo TLS server

- No concurrency, one client-at-a-time
- Blocking
- No client certs
- Fixed chain and key file names
- Minimal support for session resumption

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

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 agoRemove configuration targets and related documentation for Guardian builds.
Randall S. Becker [Thu, 6 Jun 2024 20:57:10 +0000 (20:57 +0000)] 
Remove configuration targets and related documentation for Guardian builds.

The intermediate configuration items to support Guardian builds are left
in place as a convenience for users who want to set up configurations
for Guardian on their own.

Fixes: #22175
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/24579)

13 months agoAdd support for targetingInformation X.509v3 extension
Jonathan M. Wilbur [Sat, 1 Jun 2024 19:23:25 +0000 (19:23 +0000)] 
Add support for targetingInformation X.509v3 extension

Support for the targetingInformation X.509v3 extension defined in ITU-T
Recommendation X.509 (2019), Section 17.1.2.2. This extension is used
in attribute certificates.

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

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)

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)

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)

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)

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)

13 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)

13 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)

13 months agoadd static analysis workflow for on-premise Coverity Connect
Dmitry Misharov [Thu, 30 May 2024 14:12:37 +0000 (16:12 +0200)] 
add static analysis workflow for on-premise Coverity Connect

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24534)

13 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)

13 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)

13 months agoAllow group methods to customize initialization for speed
Watson Ladd [Tue, 21 Nov 2023 17:59:05 +0000 (12:59 -0500)] 
Allow group methods to customize initialization for speed

This commit also adds an implementation for P256 that avoids some
expensive initialization of Montgomery arithmetic structures in favor
of precomputation. Since ECC groups are not always cached by higher
layers this brings significant savings to TLS handshakes.

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

13 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)

13 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)

(cherry picked from commit 6152b08631568551f155f9d8219298f55aef5d94)

14 months agoSkip newly added blocked OAEP SHAKE testcases with old fips providers
Tomas Mraz [Wed, 29 May 2024 14:32:19 +0000 (16:32 +0200)] 
Skip newly added blocked OAEP SHAKE testcases with old fips providers

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

14 months agoRemove the dead store in EVP_DecryptFinal_ex
CoolThi [Wed, 29 May 2024 10:24:56 +0000 (18:24 +0800)] 
Remove the dead store in EVP_DecryptFinal_ex

CLA: trivial

Reviewed-by: Richard Levitte <levitte@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/24526)

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)

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)

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)

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)

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)

14 months agoFix potential memory leak in OSSL_IETF_ATTR_SYNTAX_add1_value()
sashan [Wed, 22 May 2024 04:40:41 +0000 (06:40 +0200)] 
Fix potential memory leak in OSSL_IETF_ATTR_SYNTAX_add1_value()

The function may leak memory if it deals with an unknown type.
Issue reported by LuMingYinDetect.

Fixes #24452

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

14 months agoCHANGES.md: add an entry about newly deprecated time-related functions
Alexander Kanavin [Fri, 17 May 2024 11:28:05 +0000 (13:28 +0200)] 
CHANGES.md: add an entry about newly deprecated time-related functions

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agossl_sess.c: deprecate SSL_SESSION_get_time/SSL_SESSION_set_time
Alexander Kanavin [Tue, 30 Apr 2024 09:54:42 +0000 (11:54 +0200)] 
ssl_sess.c: deprecate SSL_SESSION_get_time/SSL_SESSION_set_time

Adjust the manpages at the same time so that only the new
functions are being presented.

Fixes: #23648
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agossl_sess.c: deprecate SSL_CTX_flush_sessions in favour of _ex() replacement
Alexander Kanavin [Fri, 17 May 2024 11:49:21 +0000 (13:49 +0200)] 
ssl_sess.c: deprecate SSL_CTX_flush_sessions in favour of _ex() replacement

The original function is using long for time and is therefore
not Y2038-safe.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoinclude/openssl/macros.h: define deprecation macros for 3.4
Alexander Kanavin [Tue, 30 Apr 2024 09:31:49 +0000 (11:31 +0200)] 
include/openssl/macros.h: define deprecation macros for 3.4

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoutil/perl/OpenSSL/ParseC.pm: correctly parse OSSL_DEPRECATEDIN_..._FOR
Alexander Kanavin [Fri, 17 May 2024 11:17:16 +0000 (13:17 +0200)] 
util/perl/OpenSSL/ParseC.pm: correctly parse OSSL_DEPRECATEDIN_..._FOR

Suggested by Matt Caswell.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoRemoved hard coded value for cap in function ossl_rsa_multip_cap
Gopal Sharma [Tue, 16 Jan 2024 09:20:12 +0000 (14:50 +0530)] 
Removed hard coded value for cap in function ossl_rsa_multip_cap

As suggested at https://github.com/openssl/openssl/pull/23280#discussion_r1452113014, removing hard coded value for cap.

CLA: trivial

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

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)