]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
7 days agofix SM2 privatekey decode(PEM format, ECPrivateKey).
Alen Yan [Wed, 9 Jul 2025 01:23:00 +0000 (09:23 +0800)] 
fix SM2 privatekey decode(PEM format, ECPrivateKey).

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

8 days agoopenssl rand command should use the loaded library context
Daniel Van Geest [Wed, 23 Jul 2025 08:30:57 +0000 (10:30 +0200)] 
openssl rand command should use the loaded library context

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

8 days agotest/timing_load_creds.c: Add fclose() if error occurs
Jiasheng Jiang [Wed, 9 Jul 2025 21:10:51 +0000 (21:10 +0000)] 
test/timing_load_creds.c: Add fclose() if error occurs

Add fclose() if error occurs to release fp.

Fixes: 6212fc6814 ("Add a stand-alone "timing" program")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28007)

8 days agoLoongArch: Add SHA-512 assembly implementation for better performance on small-size... feature/quic-0-rtt
Julian Zhu [Thu, 26 Jun 2025 06:14:45 +0000 (14:14 +0800)] 
LoongArch: Add SHA-512 assembly implementation for better performance on small-size data

Signed-off-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27904)

8 days agoLoongArch: Add SHA-256 assembly implementation for better performance
Julian Zhu [Fri, 20 Jun 2025 07:59:08 +0000 (15:59 +0800)] 
LoongArch: Add SHA-256 assembly implementation for better performance

It can get about 25%~ better performance than compiler-generated code (gcc version 15.1.1).

Signed-off-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27904)

9 days ago--amend
Dmitry Misharov [Tue, 22 Jul 2025 06:58:27 +0000 (08:58 +0200)] 
--amend

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27467)

9 days agoreplace GitHub Actions in Windows jobs
Dmitry Misharov [Tue, 22 Apr 2025 06:37:45 +0000 (08:37 +0200)] 
replace GitHub Actions in Windows jobs

Most of the GitHub Actions can be replaced with a couple of commands.
This will reduce dependencies bloating and some attacks surface.
This commit replaces all GitHub Actions which are not from GitHub
and Cygwin for Windows jobs with plain commands.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27467)

9 days agoFix perl warnings on various scripts
Norbert Pocs [Tue, 15 Jul 2025 09:54:23 +0000 (11:54 +0200)] 
Fix perl warnings on various scripts

Resolves: https://github.com/openssl/project/issues/1273

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28046)

9 days agosm2: add some signing tests.
Pauli [Wed, 9 Jul 2025 02:54:21 +0000 (12:54 +1000)] 
sm2: add some signing tests.

Because SM2 uses entropy as part of it's signing process, there were no
signing tests under evp_test.  This corrects the shortcoming.

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

9 days agoevp_test: add a new global "Test-Entropy" line to allow deterministic `random` input.
Pauli [Wed, 9 Jul 2025 02:50:02 +0000 (12:50 +1000)] 
evp_test: add a new global "Test-Entropy" line to allow deterministic `random` input.

When specified, this directive replaces the public and private DRBGs
with a generator that returns the specified bytes.  If more bytes are
requested than are specified, the generator loops around the supplied
bytes to satisfy the request.

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

9 days agosm2 test: remove unnecessary available in lines
Pauli [Tue, 8 Jul 2025 23:40:16 +0000 (09:40 +1000)] 
sm2 test: remove unnecessary available in lines

This test is only run against the default provider so no need to double
check this.

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

10 days agoECX/ED keymanager param getter fixes.
slontis [Tue, 15 Jul 2025 02:54:04 +0000 (12:54 +1000)] 
ECX/ED keymanager param getter fixes.

Fixes #28034

ECX and ED were sharing the same code for the getter, whilst also
maintaining seperate gettable tables.

The code has been reworked so that common code is shared, and algorithm
specific code is seperated out to make this clearer.

This fixes:
(1) The security category not being in the gettable table for ED
(2) The fips indicator for ED. i.e There is no fips indicator for ED
(previously there was no gettable, but the get() still tried to return
unapproved).

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

10 days agoRaise PROV_R_NULL_OUTPUT_BUFFER if shsec is NULL in ml_kem_encapsulate()
lanming [Thu, 10 Jul 2025 02:20:05 +0000 (10:20 +0800)] 
Raise PROV_R_NULL_OUTPUT_BUFFER if shsec is NULL in ml_kem_encapsulate()

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

11 days agoAdd CODEOWNERS file
Dmitry Misharov [Fri, 18 Jul 2025 06:12:56 +0000 (08:12 +0200)] 
Add CODEOWNERS file

quarckster is the owner of the /.github/workflows/ directory.

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

11 days agopin GitHub Actions revisions from untrusted vendors
Dmitry Misharov [Thu, 27 Mar 2025 15:49:20 +0000 (16:49 +0100)] 
pin GitHub Actions revisions from untrusted vendors

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

11 days agoUpdate container images in OS Zoo CI workflow
Dmitry Misharov [Wed, 16 Jul 2025 09:05:27 +0000 (11:05 +0200)] 
Update container images in OS Zoo CI workflow

Replace outdated and unsupported distro versions with up-to-date ones.

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

2 weeks agoevp_pkey_type: Make base_id_conversion table static
Norbert Pocs [Fri, 18 Jul 2025 06:55:18 +0000 (08:55 +0200)] 
evp_pkey_type: Make base_id_conversion table static

This commit fixes CI failures (when configured with --strict-warnings)

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28061)

2 weeks agoAdd AES-CFB128 optimizations with Intel AVX-512 and VAES
Stanciu, Adrian [Fri, 30 May 2025 16:17:26 +0000 (19:17 +0300)] 
Add AES-CFB128 optimizations with Intel AVX-512 and VAES

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

2 weeks agoExtract AES CFB implementation to cipher_aes_cfb*
Adrian Stanciu [Thu, 27 Feb 2025 08:59:36 +0000 (10:59 +0200)] 
Extract AES CFB implementation to cipher_aes_cfb*

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

2 weeks agoAdd workflow to check perl core modules for 5.10.1
Norbert Pocs [Thu, 10 Jul 2025 18:23:00 +0000 (20:23 +0200)] 
Add workflow to check perl core modules for 5.10.1

The motivation is to notice if we would add a module which is not a core
module in the minimal supported perl version.

This does not fail on other errors or warnings by perl, but we should
clear out those also.

Resolves: https://github.com/openssl/project/issues/1269

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28024)

2 weeks agoDeprecate ASN1_METH related tests
Norbert Pocs [Tue, 17 Jun 2025 10:43:12 +0000 (12:43 +0200)] 
Deprecate ASN1_METH related tests

ASN1 tests had to be turned off, but the biggest change is the
ssl_test_ctx, where the NID resolution does not equal to the old one and
a little hack had to be used to make the test work.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoDeprecate ASN1_METH internal usage
Norbert Pocs [Tue, 17 Jun 2025 10:47:54 +0000 (12:47 +0200)] 
Deprecate ASN1_METH internal usage

Some of them are needed and were kept by adding `#include
"internal/deprecated"` and some had to be turned off.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agolibcrypto.num: Deprecate EVP_PKEY_ASN1_METHOD related functions
Norbert Pocs [Fri, 23 May 2025 10:08:39 +0000 (12:08 +0200)] 
libcrypto.num: Deprecate EVP_PKEY_ASN1_METHOD related functions

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoUpdate documentation on EVP_PKEY_ASN1_METHOD deprecation
Norbert Pocs [Thu, 22 May 2025 10:23:56 +0000 (12:23 +0200)] 
Update documentation on EVP_PKEY_ASN1_METHOD deprecation

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoDeprecate EVP_PKEY_ASN1_METHOD related function declarations and definitions
Norbert Pocs [Thu, 22 May 2025 10:01:19 +0000 (12:01 +0200)] 
Deprecate EVP_PKEY_ASN1_METHOD related function declarations and definitions

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoAdd deprecation macros for 3.6.0
Norbert Pocs [Thu, 22 May 2025 09:45:49 +0000 (11:45 +0200)] 
Add deprecation macros for 3.6.0

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoproviders/implementations/digests/sha3_prov.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:31:42 +0000 (16:31 +0200)] 
providers/implementations/digests/sha3_prov.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/params.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:21:49 +0000 (16:21 +0200)] 
crypto/params.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/init.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:16:34 +0000 (16:16 +0200)] 
crypto/init.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/threads_pthread.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:11:39 +0000 (16:11 +0200)] 
crypto/threads_pthread.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/mem.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:58:52 +0000 (15:58 +0200)] 
crypto/mem.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/bn/bn_gf2m.c: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:53:31 +0000 (15:53 +0200)] 
crypto/bn/bn_gf2m.c: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agoinclude/crypto/md32_common.h: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:44:04 +0000 (15:44 +0200)] 
include/crypto/md32_common.h: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/bn/bn_lib.c: optimize - seems to bring not much benefit
Norbert Pocs [Thu, 3 Jul 2025 13:36:21 +0000 (15:36 +0200)] 
crypto/bn/bn_lib.c: optimize - seems to bring not much benefit

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/evp/digest.c: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 10:04:52 +0000 (12:04 +0200)] 
crypto/evp/digest.c: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agoUpdate doc on CRYPTO_MEM_SEC(_MINSIZE)
Norbert Pocs [Mon, 14 Jul 2025 13:59:07 +0000 (15:59 +0200)] 
Update doc on CRYPTO_MEM_SEC(_MINSIZE)

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28036)

2 weeks agoopenssl: Add option to init sec mem at startup
Norbert Pocs [Mon, 14 Jul 2025 13:01:24 +0000 (15:01 +0200)] 
openssl: Add option to init sec mem at startup

Adding env variables OPENSSL_SEC_MEM and OPENSSL_SEC_MEM_MINSIZE, which
initializes the secure memory at the beginning of the openssl app.

Resolves: https://github.com/openssl/project/issues/786

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28036)

2 weeks agoLMS: Coverity Fix 1659010 (Unused Value)
slontis [Mon, 14 Jul 2025 01:06:10 +0000 (11:06 +1000)] 
LMS: Coverity Fix 1659010 (Unused Value)

This was a false positive in a test.
The code has been reordered to make the flow clearer.

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

2 weeks agoLMS Coverity fix 1659009
slontis [Mon, 14 Jul 2025 01:01:41 +0000 (11:01 +1000)] 
LMS Coverity fix 1659009

Fix deref after free.

If ctx->key is already set and the passed in key is NULL then ctx->key
should not be set to NULL.

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

2 weeks agoconst up ERR_str_libraries
Caolán McNamara [Sun, 13 Jul 2025 19:21:19 +0000 (20:21 +0100)] 
const up ERR_str_libraries

CLA: trivial

move this symbol out of the .data section

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

2 weeks agosec_mem: add note about the perf implications
Nikola Pajkovsky [Thu, 10 Jul 2025 07:03:38 +0000 (09:03 +0200)] 
sec_mem: add note about the perf implications

Testing secure storage for ml-kem/dsa [1] shows performace penalty
when secure storage is enabled.

| Threads | baseline usec/handshake | secmem usec/handshake |
|---------+-------------------------+-----------------------|
|       1 |              586.784756 |            588.306131 |
|       2 |              599.537648 |            601.007393 |
|       4 |              610.663361 |            613.600663 |
|       8 |              649.347376 |            869.693358 |
|      16 |             1176.402781 |           2487.335286 |
|      32 |             2345.594618 |           5155.747515 |
|      64 |             4697.556045 |          11170.627031 |

the test shows that sec mem is ok-ish up to the number of available cores,
and when the sec mem lock gets contended, performance goes down rapidly.
Tested on Apple M4 Pro.

[1] https://github.com/openssl/openssl/pull/27625

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28011)

2 weeks agoci: enable lms only on master
Nikola Pajkovsky [Fri, 11 Jul 2025 07:18:12 +0000 (09:18 +0200)] 
ci: enable lms only on master

a new config option cannot be enabled globally because the option
was not backported to the older versions.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28019)

3 weeks agoAdd lock contention checking to our pthreads implementation
Neil Horman [Tue, 24 Jun 2025 17:50:09 +0000 (13:50 -0400)] 
Add lock contention checking to our pthreads implementation

Something we're missing in our ability to do performance monitoring
and diagnosis in openssl is the ability to check for lock contention.
While some tools exist for this (valgrinds drd tool for example), they
really only measure the time spent in critical sections, not the
instances in which they are contended.  For that we need something more
specific.

This patch introduces the REPORT_RWLOCK_CONTENTION macro.  When openssl
is built with:
./Configure -rdynamic -fno-omit-frame-pointer -DREPORT_RWLOCK_CONTENTION

We can now get output sent to a log file that looks like the following:

===============
lock blocked on WRITE for 1001 usec
/lib64/libasan.so.8(+0x525e7) [0x7fc5ef4525e7]
../../test/quic_radix_test(CRYPTO_THREAD_write_lock+0x151) [0x79d976]
../../test/quic_radix_test() [0x61e6fb]
../../test/quic_radix_test(test_vprintf_stderr+0x15) [0x61e78d]
../../test/quic_radix_test(test_printf_stderr+0x10f) [0x623ba4]
../../test/quic_radix_test(test_fail_message_prefix+0xf7) [0x62436b]
../../test/quic_radix_test() [0x6243b9]
../../test/quic_radix_test(test_info+0x133) [0x624842]
../../test/quic_radix_test() [0x415aad]
../../test/quic_radix_test() [0x417bad]
../../test/quic_radix_test() [0x41b1a9]
../../test/quic_radix_test() [0x41b2eb]
../../test/quic_radix_test() [0x8071fc]
/lib64/libasan.so.8(+0x28ee6) [0x7fc5ef428ee6]
/lib64/libc.so.6(+0x711d4) [0x7fc5ef27f1d4]
/lib64/libc.so.6(+0xf3cec) [0x7fc5ef301cec]
==============

Which tells us when a thread blocked because someone else was already
holding the lock, how long it was blocked for, and where the blocking
call originated from via its backtrace.

I think this should enable us to better determine where our contended
locking paths are for a given application, and give us some insight on
how to fix them.

Currently its linux only (as the backtrace functionality only exists
there, and there are few warts (like the need to use a file pointer
rather than a bio to record the log, see comments), but I think its
enough to give us a useful diagnostic tool to help drive some
performance improvements.

Fixes openssl/project#1237

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

3 weeks agoMake the lock in CRYPTO_secure_actual_size a read lock
Nikola Pajkovsky [Thu, 10 Jul 2025 07:48:15 +0000 (09:48 +0200)] 
Make the lock in CRYPTO_secure_actual_size a read lock

there is no operations within critical section that would
require write lock.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28014)

3 weeks agoAdd note about use of EVP_PKEY in different libctxs
Michael Baentsch [Mon, 30 Jun 2025 07:33:46 +0000 (09:33 +0200)] 
Add note about use of EVP_PKEY in different libctxs

Co-authored-by: Shane Lontis <slontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26309)

3 weeks agoPEM_read_CMS.pod: Correct the deprecation notice
Tomas Mraz [Fri, 20 Jun 2025 15:07:19 +0000 (17:07 +0200)] 
PEM_read_CMS.pod: Correct the deprecation notice

Fixes #27863

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

3 weeks agoProvide X509_CRL_get0_tbs_sigalg()
Theo Buehler [Sun, 6 Jul 2025 11:55:52 +0000 (13:55 +0200)] 
Provide X509_CRL_get0_tbs_sigalg()

X509_CRL_get0_tbs_sigalg() corresponds to X509_get0_tbs_sigalg() and
retrieves the AlgorithmIdentifier inside the TBSCertList which is not
currently accessible in any sane way from public API.

This PR adds X509_get0_tbs_sigalg() to the public API, documents it,
adds a simple regress check so there is coverage and mentions the
addition in CHANGES.md.

On top of that, fix a typo in .gitignore and clean up some order
inconsistencies in X509_get0_signature.pod.

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

3 weeks agotest/quic-openssl-docker/hq-interop/quic-hq-interop.c: Move BIO_free() to err label...
Jiasheng Jiang [Tue, 8 Jul 2025 23:18:43 +0000 (23:18 +0000)] 
test/quic-openssl-docker/hq-interop/quic-hq-interop.c: Move BIO_free() to err label to avoid memory leak

Relocate the BIO_free() call to the 'err' label to ensure the memory is properly freed in case of an error.

Fixes: ec6200bf0f ("Move hq-interop code to test/quic-openssl-docker")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27995)

3 weeks agoQUIC receiver may accidentally ACK packet it fails to process
Alexandr Nedvedicky [Wed, 9 Jul 2025 09:24:38 +0000 (11:24 +0200)] 
QUIC receiver may accidentally ACK packet it fails to process

we set ok to -1 as we enter ossl_quic_handle_frames().  If we
set ok to 0 here we effectively assume successful processing
of all frames found in packet. We do this just before
we return from function:

```
  1479
  1480     /* Now that special cases are out of the way, parse frames */
  1481     if (!PACKET_buf_init(&pkt, qpacket->hdr->data, qpacket->hdr->len)
  1482         || !depack_process_frames(ch, &pkt, qpacket,
  1483                                   enc_level,
  1484                                   qpacket->time,
  1485                                   &ackm_data))
  1486         goto end;
  1487
  1488     ok = 1;
  1489  end:
  1490     /*
  1491      * ASSUMPTION: If this function is called at all, |qpacket| is
  1492      * a legitimate packet, even if its contents aren't.
  1493      * Therefore, we call ossl_ackm_on_rx_packet() unconditionally, as long as
  1494      * |ackm_data| has at least been initialized.
  1495      */
  1496     if (ok >= 0)
  1497         ossl_ackm_on_rx_packet(ch->ackm, &ackm_data);
  1498
  1499     return ok > 0;
```

if the call to `depack_process_frames()` at line 1492 fails, because
barticualr frame in packet is corrupted/invalid we take a branch
to `end:` goto target. In this case we must avoid the call to
`ossl_ackm_on_rx_packet()`. Packet with malformed/invalid frame
must not be accepted. See RFC 9000 section 13.1:

    Once the packet has been fully processed, a receiver acknowledges
    receipt by sending one or more ACK frames containing the packet
    number of the received packet.

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

3 weeks agoDOC: Fixup FIPS provider documentation.
slontis [Mon, 7 Jul 2025 07:04:09 +0000 (17:04 +1000)] 
DOC: Fixup FIPS provider documentation.

SHAKE3 was missing from the list.
Also clarified that KECCAK-KMAC is internal.

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

3 weeks agoLMS code review fixups
slontis [Mon, 7 Jul 2025 02:11:52 +0000 (12:11 +1000)] 
LMS code review fixups

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

3 weeks agoAdd LMS evp_test using NIST ACVP test data.
slontis [Wed, 2 Jul 2025 08:21:39 +0000 (18:21 +1000)] 
Add LMS evp_test using NIST ACVP test data.

This covers all LMS algorithm parameter sets.

The following changes were done to handle the tests:
 (1) Changed LMS to use OSSL_PKEY_PARAM_PUB_KEY instead of
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY for import/export.
(There is no reason to have the encoded form for verify operations).
 (2) Fixed a bug for W=1 with truncated digests. The checksum was using
a value of 8-w, which was off by 1 for this case. A value was added to
the ots parameters that represents this value.
 (3) A check in evp_test for a NID was removed since LMS does not have
OIDS (HSS does).
 (4) the unused PROPERTIES param was removed from the LMS keymanager.

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

3 weeks agotest: get the LMS test recipe run non-FIPS tests
Richard Levitte [Sun, 29 Jun 2025 08:41:33 +0000 (10:41 +0200)] 
test: get the LMS test recipe run non-FIPS tests

This places the FIPS specific tests in a skippable block.

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

3 weeks agoci: enable LMS in a number of different builds
Pauli [Mon, 30 Jun 2025 22:43:54 +0000 (08:43 +1000)] 
ci: enable LMS in a number of different builds

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

3 weeks agoMake LMS disabled by default
Pauli [Mon, 30 Jun 2025 22:20:54 +0000 (08:20 +1000)] 
Make LMS disabled by default

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

3 weeks agolms_test: add key gen negative test
Pauli [Thu, 26 Jun 2025 21:17:12 +0000 (07:17 +1000)] 
lms_test: add key gen negative test

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

3 weeks agolms: add negative tests
Pauli [Thu, 26 Jun 2025 08:44:56 +0000 (18:44 +1000)] 
lms: add negative tests

For EVP_PKEY_sign_message_init and EVP_PKEY_paramgen_init.

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

3 weeks agolms: add signing negative test
Pauli [Thu, 26 Jun 2025 08:36:37 +0000 (18:36 +1000)] 
lms: add signing negative test

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

3 weeks agopacket: add new utility function PACKET_get_4_len()
Pauli [Wed, 25 Jun 2025 23:03:38 +0000 (09:03 +1000)] 
packet: add new utility function PACKET_get_4_len()

Get 4 bytes in network order from |pkt| and store the value in |*data|
Similar to PACKET_get_net_4() except the data is uint32_t

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

3 weeks agotest: get provider compatibily tests working
Pauli [Mon, 3 Feb 2025 23:47:24 +0000 (10:47 +1100)] 
test: get provider compatibily tests working

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

3 weeks agoAdd changes entry for LMS verification
Pauli [Thu, 23 Jan 2025 20:55:48 +0000 (07:55 +1100)] 
Add changes entry for LMS verification

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

3 weeks agodoc: document the additional LMS self test description
Pauli [Mon, 13 Jan 2025 01:43:10 +0000 (12:43 +1100)] 
doc: document the additional LMS self test description

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

3 weeks agofips: add self test CAST for LMS verify
Pauli [Mon, 13 Jan 2025 01:41:49 +0000 (12:41 +1100)] 
fips: add self test CAST for LMS verify

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

3 weeks agofips: add LMS description
Pauli [Mon, 13 Jan 2025 01:41:04 +0000 (12:41 +1100)] 
fips: add LMS description

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

3 weeks agoFix indentation
Pauli [Sun, 12 Jan 2025 23:23:50 +0000 (10:23 +1100)] 
Fix indentation

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

3 weeks agoAdd LMS documentation
slontis [Thu, 3 Oct 2024 07:52:49 +0000 (17:52 +1000)] 
Add LMS documentation

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

3 weeks agoAdd LMS to the fips provider.
slontis [Tue, 1 Oct 2024 06:17:05 +0000 (16:17 +1000)] 
Add LMS to the fips provider.

This required the LMS keymanager to have an export function.
The self test will be provided by HSS, which covers the LMS case.

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

3 weeks agoAllow SHA256-192 to be used internally in the FIPS provider.
slontis [Mon, 30 Sep 2024 05:37:57 +0000 (15:37 +1000)] 
Allow SHA256-192 to be used internally in the FIPS provider.

Created an internal digest table that contains sha256_192.
Also moved the KECCAK_KMAC_128/256 entries to this internal table
since it is only used by KMAC.

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

3 weeks agoAdd LMS Signature verification.
slontis [Tue, 1 Oct 2024 02:35:43 +0000 (12:35 +1000)] 
Add LMS Signature verification.

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

3 weeks agoAdd LMS public key decoder.
slontis [Mon, 30 Sep 2024 16:38:58 +0000 (02:38 +1000)] 
Add LMS public key decoder.

This uses OSSL_DECODER_CTX_new_for_pkey().
"XDR" can be specified for the input type, and the key type is "LMS"

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

3 weeks agoAdd base code to load a LMS public key.
slontis [Thu, 3 Oct 2024 01:16:15 +0000 (11:16 +1000)] 
Add base code to load a LMS public key.

This loads a XDR encoded LMS public key.
It adds a simple LMS keymanager to import this key.

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

3 weeks agoAdd Configurable "lms" option
slontis [Thu, 3 Oct 2024 01:10:01 +0000 (11:10 +1000)] 
Add Configurable "lms" option

This option will be used by the base code for enabling
Leighton-Micali Signatures (LMS)

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

3 weeks agoHKDF updates
Daniel Van Geest [Mon, 7 Apr 2025 11:21:47 +0000 (12:21 +0100)] 
HKDF updates

- prevent fixed-digest HKDF from having its digest changed
- implement gettable params in HKDF
- update fixed-digest HKDF tests

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

3 weeks agoAdd fixed-digest HKDF documentation
Daniel Van Geest [Fri, 4 Apr 2025 09:25:48 +0000 (10:25 +0100)] 
Add fixed-digest HKDF documentation

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

3 weeks agoAdd HKDF algorithms with fixed digests.
Daniel Van Geest [Thu, 3 Apr 2025 09:45:20 +0000 (10:45 +0100)] 
Add HKDF algorithms with fixed digests.

Add HKDF-SHA256, HKDF-SHA384 and HKDF-SHA512 which are versions
of HKDF that have the digest pre-set. The digest cannot be changed
for contexts of these types.

RFC 8619 defines algorithm identifiers for these combinations.
These algorithm identifiers will be used in future features, e.g.
KEMRecipientInfo.

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

3 weeks agoAddress coverity issue 1655295
Norbert Pocs [Tue, 8 Jul 2025 08:10:32 +0000 (10:10 +0200)] 
Address coverity issue 1655295

Fixes: https://github.com/openssl/project/issues/1267
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27989)

3 weeks agoAddress coverity issue 1655294
Norbert Pocs [Tue, 8 Jul 2025 08:05:00 +0000 (10:05 +0200)] 
Address coverity issue 1655294

Fixes: https://github.com/openssl/project/issues/1267
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27989)

3 weeks agoIntroduce SSL_OP_SERVER_PREFERENCE to replace SSL_OP_CIPHER_SERVER_PREFERENCE misnomer
Michael Baentsch [Mon, 7 Jul 2025 13:00:01 +0000 (15:00 +0200)] 
Introduce SSL_OP_SERVER_PREFERENCE to replace SSL_OP_CIPHER_SERVER_PREFERENCE misnomer

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

3 weeks agoFixup non-optional use of IO::Socket::IP
Neil Horman [Tue, 1 Jul 2025 18:19:17 +0000 (14:19 -0400)] 
Fixup non-optional use of IO::Socket::IP

IO::Socket::IP is an optionally used package in our perl scripts, and a
recent change of mine used it unilaterally, causing breakage on older
perl installations.  Fix it up to use it optionally again, falling back
to IO::Socket::INET when needed.

Fixes #27940

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

3 weeks agoUpdate rpki-client-portable to fix build
Theo Buehler [Wed, 9 Jul 2025 09:33:57 +0000 (11:33 +0200)] 
Update rpki-client-portable to fix build

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

3 weeks agocrypto/slh_dsa/slh_hash.c: Add check for EVP_MD_get_size()
Jiasheng Jiang [Thu, 26 Jun 2025 00:58:51 +0000 (00:58 +0000)] 
crypto/slh_dsa/slh_hash.c: Add check for EVP_MD_get_size()

Add the check for the return value of EVP_MD_get_size() to avoid invalid size.

Fixes: 2f9e152d86 ("Add SLH_DSA signature verification.")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27900)

3 weeks agoSeparate public and private ML-KEM allocations
Daniel Frink [Mon, 9 Jun 2025 21:26:32 +0000 (16:26 -0500)] 
Separate public and private ML-KEM allocations

Previously, this change had grouped the public and private
portions of the ML-KEM key structure into one allocation that
was changed to use secure memory. There were concerns raised
that there may be use cases where storage of many ML-KEM public
keys may be necessary. Since the total secure memory size is configured
by the user, reduce the footprint of secure memory usage to
reduce the impact of these changes on users of these flows.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27625)

3 weeks agoUse secure memory allocation for ML-KEM and ML-DSA private key storage areas
Daniel Frink [Tue, 13 May 2025 20:27:05 +0000 (15:27 -0500)] 
Use secure memory allocation for ML-KEM and ML-DSA private key storage areas

Resolves: #27603

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27625)

3 weeks agoRISC-V: Provide optimized SM3 implementation using Zbb extension
Julian Zhu [Wed, 28 May 2025 05:24:24 +0000 (13:24 +0800)] 
RISC-V: Provide optimized SM3 implementation using Zbb extension

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27709)

3 weeks agoAdd CI for backports to be run when respective branch label is set
Tomas Mraz [Wed, 2 Jul 2025 10:25:02 +0000 (12:25 +0200)] 
Add CI for backports to be run when respective branch label is set

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27947)

3 weeks agoAdd .[ch].in files to ctags
Neil Horman [Fri, 4 Jul 2025 11:57:19 +0000 (07:57 -0400)] 
Add .[ch].in files to ctags

Pull in our templates for various c and h files for searching

Fixes #27966

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27967)

4 weeks agoUpdate util/analyze-contention-log.sh
Neil Horman [Wed, 2 Jul 2025 11:03:36 +0000 (07:03 -0400)] 
Update util/analyze-contention-log.sh

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

4 weeks agoAdd lock contention log analyzer
Neil Horman [Thu, 26 Jun 2025 17:38:43 +0000 (13:38 -0400)] 
Add lock contention log analyzer

With the introduction of REPORT_RWLOCK_CONTENTION, it would be nice
if we could do some quick analysis on it.

This script parses the log, and generates a histogram of lock contention
events, uniquely identified by the stack trace that caused it, and
prints out all unique latency event, sorted from largest (as measured
by cumulative latency in that path).

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

4 weeks agoFix some conversion from size_t to const int errors
Matt Caswell [Thu, 3 Jul 2025 13:45:09 +0000 (14:45 +0100)] 
Fix some conversion from size_t to const int errors

When #27806 was merged these fixes were missed

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

4 weeks agoThe check-ansi job is failing in the openssl-3.5 branch as a result of commit 60775e3...
Daniel Van Geest [Tue, 1 Jul 2025 20:57:57 +0000 (21:57 +0100)] 
The check-ansi job is failing in the openssl-3.5 branch as a result of commit 60775e3. Fix that.

I guess this job doesn't run on PRs in master?

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

(cherry picked from commit 96fa08c6a521b30da54b9b5847bf4a62ee46acab)

4 weeks agoExtend create_accept_stream test
Andrew Dinh [Mon, 30 Jun 2025 15:21:48 +0000 (22:21 +0700)] 
Extend create_accept_stream test

- Create more options for creating server-initiated
- Check that correct stream is accepted with SSL_get_stream_type

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

4 weeks agoAdd test for SSL_accept_stream
Andrew Dinh [Thu, 26 Jun 2025 15:37:18 +0000 (22:37 +0700)] 
Add test for SSL_accept_stream

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

4 weeks agoAdd stream type flags to SSL_accept_stream
Andrew Dinh [Tue, 24 Jun 2025 12:26:38 +0000 (19:26 +0700)] 
Add stream type flags to SSL_accept_stream

Introduces SSL_ACCEPT_STREAM_UNI and SSL_ACCEPT_STREAM_BIDI flags to SSL_accept_stream, allowing callers to specify whether to accept only unidirectional or bidirectional streams. Returns the first of its type from the queue

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

4 weeks agoRemove need for BN_BLINDING lock
Neil Horman [Wed, 25 Jun 2025 18:26:24 +0000 (14:26 -0400)] 
Remove need for BN_BLINDING lock

Issue https://github.com/openssl/project/issues/1245 has identified that
we encounter a significant amount of time waiting to acquire the
BN_BLINDING_lock when running our handshake perf test with 10 threads
using an rsa key.  Specifically, with 10 threads we spend about 19327731
usecs just waiting.  So it would be great if we could eliminate the need
to get the write lock here.

Currently, the need for the lock is based off the fact that each rsa key
has only a single blinding pointer, for which exclusive access is
needed, with an attempt to use a fallback mt_blinding pointer in the
shared case.  If a key is shared by many threads, then we find ourselves
needing to maniuplate this lock quite frequently if we are doing lots of
ssl connections.

To address this, I've come up with this approach.  It replaces the
blinding pointer with a pointer to a sparse array.  The sparse array is
then indexed by thread id.  This allows us to do two things:

When getting the blinding, we only need to take the read lock in the
common case when looking up this threads blinding structure.  Only in
the first lookup for any thread do we need to take the write side lock
when updating the table, and only then for a very brief critical section
(i.e. we don't need to hold the lock when allocating/setting the
blinding up via RSA_setup_blinding

This trades off some extra memory usage for the above significant
reduction in execution time.

it also allows us to simplify the blinding code quite a bit by
eliminating the need to handle shared blindings because blindings are
never shared anymore

Fixes openssl/project#1245

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

4 weeks agodemos: Silence warnings on Win64 builds
Tomas Mraz [Thu, 19 Jun 2025 08:12:13 +0000 (10:12 +0200)] 
demos: Silence warnings on Win64 builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

4 weeks agoCI: Enable strict warnings on all Windows CI builds
Tomas Mraz [Wed, 18 Jun 2025 16:45:24 +0000 (18:45 +0200)] 
CI: Enable strict warnings on all Windows CI builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

4 weeks agotest: Silence warnings on Win64 builds
Tomas Mraz [Wed, 18 Jun 2025 09:59:04 +0000 (11:59 +0200)] 
test: Silence warnings on Win64 builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

4 weeks agofuzz: Silence warnings on Win64 builds
Tomas Mraz [Wed, 18 Jun 2025 08:50:27 +0000 (10:50 +0200)] 
fuzz: Silence warnings on Win64 builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

4 weeks agoapps: Silence warnings on Win64 builds
Tomas Mraz [Tue, 17 Jun 2025 18:08:49 +0000 (20:08 +0200)] 
apps: Silence warnings on Win64 builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

4 weeks agoengines: Silence warnings on Win64 builds
Tomas Mraz [Tue, 17 Jun 2025 17:37:05 +0000 (19:37 +0200)] 
engines: Silence warnings on Win64 builds

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)