]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
4 days agots_conf: fix memory leak in TS_CONF_set_policies
DONGGEUN YOO [Mon, 29 Sep 2025 00:45:11 +0000 (00:45 +0000)] 
ts_conf: fix memory leak in TS_CONF_set_policies

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

4 days agoFix riscv64 chacha crash due to unaligned data
Bernd Edlinger [Sat, 27 Sep 2025 20:14:04 +0000 (22:14 +0200)] 
Fix riscv64 chacha crash due to unaligned data

The linux-riscv64 test machine crashes due to unaligned data,
when the V extension is enabled, while QEMU seems to have no
problems with unaligned data.

So check for aligned data and fall back to C code in case the
input or output values are unaligned.

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

4 days agoEnable the V extension in the OS-Zoo CI job
Bernd Edlinger [Sun, 28 Sep 2025 06:32:34 +0000 (08:32 +0200)] 
Enable the V extension in the OS-Zoo CI job

and also fix the unintentional omission of the ZBA extension,
since the first word in the OPENSSL_riscvcap environment variable
is ignored, because it is assumed to be the processor base
architecture, e.g. something like RV64GC.

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

4 days agoFix Memory leak in CMS_EncryptedData_set1_key
Ryan Hooper [Thu, 25 Sep 2025 16:42:24 +0000 (12:42 -0400)] 
Fix Memory leak in CMS_EncryptedData_set1_key

When CMS_EncryptedData_set1_key is called repeatedly it will
leak data on the second call. This was because
cms->d.encryptedData was already set and needed to be cleared
before the call to M_ASN1_new_of.

Fixes: #28606
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28668)

4 days agoaes: convert AES ciphers to use generated parameter decoders
Pauli [Fri, 19 Sep 2025 04:28:22 +0000 (14:28 +1000)] 
aes: convert AES ciphers to use generated parameter decoders

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

4 days agoaes: rename files in anticipation of gerenated param decoding
Pauli [Fri, 19 Sep 2025 01:30:29 +0000 (11:30 +1000)] 
aes: rename files in anticipation of gerenated param decoding

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

4 days agochacha20: convert to using genreated param name decoders
Pauli [Fri, 19 Sep 2025 01:25:19 +0000 (11:25 +1000)] 
chacha20: convert to using genreated param name decoders

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

4 days agochacha20: rename files in anticipation of generated param decoding
Pauli [Fri, 19 Sep 2025 01:16:45 +0000 (11:16 +1000)] 
chacha20: rename files in anticipation of generated param decoding

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

4 days agoxts: convert to generated param name decodering
Pauli [Fri, 19 Sep 2025 01:12:18 +0000 (11:12 +1000)] 
xts: convert to generated param name decodering

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

4 days agoctx: rename files for conversion to generated param decoders
Pauli [Fri, 19 Sep 2025 01:12:00 +0000 (11:12 +1000)] 
ctx: rename files for conversion to generated param decoders

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

4 days agolegacy ciphers: use generated param name decoders
Pauli [Fri, 19 Sep 2025 00:57:41 +0000 (10:57 +1000)] 
legacy ciphers: use generated param name decoders

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

4 days agolegacy ciphers: rename files in anticipation of using generated param decoders
Pauli [Fri, 19 Sep 2025 00:29:16 +0000 (10:29 +1000)] 
legacy ciphers: rename files in anticipation of using generated param decoders

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

4 days agoaes_cbc_hmac_sha: convert to generated param decoding
Pauli [Thu, 18 Sep 2025 06:32:13 +0000 (16:32 +1000)] 
aes_cbc_hmac_sha: convert to generated param decoding

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

4 days agoaes_cbc_hmac: rename files in anticipation of generated param decoding
Pauli [Thu, 18 Sep 2025 05:58:23 +0000 (15:58 +1000)] 
aes_cbc_hmac: rename files in anticipation of generated param decoding

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

4 days agomdc2: use a generated param decoder
Pauli [Thu, 18 Sep 2025 05:50:54 +0000 (15:50 +1000)] 
mdc2: use a generated param decoder

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

4 days agomdc2: rename files in anticipation of generated param decoding
Pauli [Thu, 18 Sep 2025 05:50:41 +0000 (15:50 +1000)] 
mdc2: rename files in anticipation of generated param decoding

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

6 days agoAdd CHANGES.md and NEWS.md updates
Tomas Mraz [Mon, 29 Sep 2025 12:23:12 +0000 (14:23 +0200)] 
Add CHANGES.md and NEWS.md updates

Including a few corrections of the previous entries.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
6 days agouse_proxy(): Add missing terminating NUL byte
Tomas Mraz [Thu, 11 Sep 2025 16:43:55 +0000 (18:43 +0200)] 
use_proxy(): Add missing terminating NUL byte

Fixes CVE-2025-9232

There is a missing terminating NUL byte after strncpy() call.
Issue and a proposed fix reported by Stanislav Fort (Aisle Research).

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
6 days agoecp_sm2p256.c: Remove unused code
Tomas Mraz [Tue, 16 Sep 2025 12:48:31 +0000 (14:48 +0200)] 
ecp_sm2p256.c: Remove unused code

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
6 days agoSM2: Use constant time modular inversion
Tomas Mraz [Thu, 11 Sep 2025 16:40:34 +0000 (18:40 +0200)] 
SM2: Use constant time modular inversion

Fixes CVE-2025-9231

Issue and a proposed fix reported by Stanislav Fort (Aisle Research).

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
6 days agokek_unwrap_key(): Fix incorrect check of unwrapped key size
Viktor Dukhovni [Thu, 11 Sep 2025 16:10:12 +0000 (18:10 +0200)] 
kek_unwrap_key(): Fix incorrect check of unwrapped key size

Fixes CVE-2025-9230

The check is off by 8 bytes so it is possible to overread by
up to 8 bytes and overwrite up to 4 bytes.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
8 days agoRevert "fips: remove redundant RSA encrypt/decrypt KAT"
Neil Horman [Thu, 25 Sep 2025 20:08:37 +0000 (16:08 -0400)] 
Revert "fips: remove redundant RSA encrypt/decrypt KAT"

This reverts commit 635bf4946a7e948f26a348ddc3b5a8d282354f64.

During code review for FIPS-140-3 certification, our lab noticed that
the known answer test for RSA was removed.  This was done in the above
commit, as part of
https://github.com/openssl/openssl/pull/25988

Under the assertion that FIPS 140-3 Implementation Guidance section D.G
had relaxed the requirements for testing, obviating the need for this
test.

However, for the 3.5 FIPS-140-3 certification we are adding assertions
for support of KAS-IFC-SSC, which follows FIPS-140-3 I.G section D.F,
which does not contain the same relaxed constraints.  As such we need to
reintroduce the test.

While the specifics of the I.G requirements are slightly different in
D.F (allowing for other, potentially less time-consuming tests), the
most expedient path forward here is to simply re-introduce the test as
it existed previously, hence the reversion of the above commit.

Fixes openssl/private#832

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

9 days agokrb5kdf.c.in: Check the key size before applying the key
Tomas Mraz [Thu, 25 Sep 2025 12:19:22 +0000 (14:19 +0200)] 
krb5kdf.c.in: Check the key size before applying the key

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

9 days agoAdd test for using KRB5KDF with erroneous key size
Tomas Mraz [Thu, 25 Sep 2025 10:21:21 +0000 (12:21 +0200)] 
Add test for using KRB5KDF with erroneous key size

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

9 days agoUpdate doc/designs/rfc4514.md
Bob Beck [Wed, 24 Sep 2025 16:16:11 +0000 (10:16 -0600)] 
Update doc/designs/rfc4514.md

Co-authored-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28639)

9 days agoAdd git pre-commit hook example to the script
Bob Beck [Mon, 22 Sep 2025 20:59:36 +0000 (14:59 -0600)] 
Add git pre-commit hook example to the script

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

9 days agounbreak url for legacy gost
Bob Beck [Mon, 22 Sep 2025 20:44:14 +0000 (14:44 -0600)] 
unbreak url for legacy gost

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

9 days agomake it not write changes by default
Bob Beck [Mon, 22 Sep 2025 20:21:06 +0000 (14:21 -0600)] 
make it not write changes by default

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

9 days agoAdd util/codespell-check.sh and run it
Bob Beck [Mon, 22 Sep 2025 19:51:32 +0000 (13:51 -0600)] 
Add util/codespell-check.sh and run it

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

10 days agoMake tests run faster on typical platforms.
Bob Beck [Tue, 2 Sep 2025 20:46:06 +0000 (14:46 -0600)] 
Make tests run faster on typical platforms.

Sadly not doable in make as it is notoriously bad at telling
you the parallelism being used by make -j.

If the HARNESS_JOBS environment variable has not been
set, this makes the perl script attempt to figure out how
many cpu's are available on anything windows/linux/macos/bsd like,
and if it can be successfully detected, we use that value.
if not, we use 1 as before.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/28426)

10 days agoChange test/recipes/95-test_external_oqsprovider.t to allow out-of-source builds
Richard Levitte [Mon, 22 Sep 2025 16:26:50 +0000 (18:26 +0200)] 
Change test/recipes/95-test_external_oqsprovider.t to allow out-of-source builds

Unfortunately, CMake's FindOpenSSL.cmake module doesn't handle OpenSSL's
build tree very well when it's out-of-source.  This is resolved by create
a local OpenSSL "installation" with a minimum amount of symbolic links,
and using that.

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

10 days agoFix EVP_PKEY_can_sign() handling of NULL from query_operation_name()
Daniel Kubec [Fri, 19 Sep 2025 13:48:41 +0000 (15:48 +0200)] 
Fix EVP_PKEY_can_sign() handling of NULL from query_operation_name()

EVP_PKEY_can_sign() assumed query_operation_name(OSSL_OP_SIGNATURE)
always returns a non-NULL string. According to the documentation,
query_operation_name() may return NULL, in which case
EVP_KEYMGMT_get0_name() should be used as a fallback.

Fixes #27790

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

10 days agoCheck for OBJ_create() conflicts after write lock.
Viktor Dukhovni [Wed, 17 Sep 2025 09:07:07 +0000 (19:07 +1000)] 
Check for OBJ_create() conflicts after write lock.

For now subsequent calls to OBJ_create() with identical inputs return
NID_undef.  It may be better to return the previous NID in the future.

The real work actually happens in OBJ_add_object().  Duplicate compares
*all* the input object's fields with any of the objects found by lookup.

If these are identical, then necessarily all the lookups found the same
data, and we can return the existing nid in low-level calls via
OBJ_add_object() that specify the nid also.  If any of the fields are
different the new object is not installed and NID_undef is returned.

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

10 days agoAdd a test for multi-threaded OBJ_create
Bernd Edlinger [Sun, 31 Aug 2025 19:41:50 +0000 (21:41 +0200)] 
Add a test for multi-threaded OBJ_create

After a successful OBJ_create the returned NID should
be the same NID that is returned from OBJ_ln2nid and
should not change any more, but after an unsuccessful
OBJ_create, another thread must have created the object,
therefore OBJ_ln2nid should not return NID_undef in that
case.

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

10 days agoFix length of digestinfo_sm3_der
xiaoloudongfeng [Tue, 2 Sep 2025 03:25:19 +0000 (11:25 +0800)] 
Fix length of digestinfo_sm3_der

This fixes the RSA-SM3 signatures to conform to the standard.

CLA: trivial

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

10 days agoFix doublefree after failure in ossl_siv128_init()
Tomas Mraz [Tue, 23 Sep 2025 15:00:00 +0000 (17:00 +0200)] 
Fix doublefree after failure in ossl_siv128_init()

The issue was reported by Ronald Crane from Zippenhop LLC.

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

11 days agoPrint PowerPC CPUINFO
Bernd Edlinger [Sat, 13 Sep 2025 10:45:00 +0000 (12:45 +0200)] 
Print PowerPC CPUINFO

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

11 days agoConst correct the various sk_find functions.
Bob Beck [Fri, 12 Sep 2025 15:18:45 +0000 (09:18 -0600)] 
Const correct the various sk_find functions.

Since we no longer mutate the stack when finding, let us
make the stack pointers const.

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

11 days agoCorrect the documentation for OPENSSL_sk_find
Bob Beck [Tue, 16 Sep 2025 21:30:31 +0000 (15:30 -0600)] 
Correct the documentation for OPENSSL_sk_find

Since April of 2023 with commit eb0935f, these functions have not
sorted the stack if it was not sorted. The documentation was noti
changed at the time to reflect this changed behaviour.

This corrects the documentation to reflect the current behaviour
of these functions

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

11 days agoClose small race condition on error raising in QUIC
Neil Horman [Tue, 23 Sep 2025 09:40:06 +0000 (05:40 -0400)] 
Close small race condition on error raising in QUIC

Github issue #28501 reported an odd condition in which a double free was
occuring when a given thread was popping entries of its error stack.

It was hypothesized that, because a few places in the quic stack save
error state to a shared structure (ch->err_state, port->error_state,
qtls->error_state), that multiple threads may attempt to mutate the
shared structure during error save/restore in parallel.

Investigation showed that all paths which led to such mutations were
done under lock, so that shouldn't occur.

Except for one case, which this PR addresses.

In ossl_quic_conn_stream_conclude, we unlock our protecting mutex, prior
to calling QUIC_RAISE_NON_NORMAL_ERROR.  If that function is called with
an reason code of SHUTDOWN, it attempts to restore the channel error
state.  Given that the lock was released first, this creates a small
race condition in which two threads may manipulate the shared error
state in the channel struct in parallel.

According to the reporter, applying this patch prevents the reported
error from occuring again.

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

12 days agoDisable HW acceleration when running TLSProxy tests
Neil Horman [Mon, 22 Sep 2025 13:01:00 +0000 (09:01 -0400)] 
Disable HW acceleration when running TLSProxy tests

IBM reported that, since the introduction of the ossltest provider,
several tests are failing on s390x

They are failing because MAC computation on s390x uses hardware
acceleration, which bypasses the use of the ossltest provided digests.

Because TLSProxy tests rely on the return of known consistent data
(which the ossltest provider gives us), the HW acceleration ignores this
giving us real MAC's instead, causing the test to fail.

We could write an HMAC provided algorithm to override that behavior, but
since this only occurs on s390, and only in cases in which the
TLSprovider is used, it seems simpler, and more maintainable to just
disable hw acceleration on those tests (given that we don't want to use
the accelerated path anyway).

Set the capabilities register for s390 to enforce this in the TLSProxy
code.

Fixes #28630

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

12 days agoSkip LMS tests if fetch for the LMS algorithm fails
Andrew Dinh [Wed, 17 Sep 2025 01:49:59 +0000 (11:49 +1000)] 
Skip LMS tests if fetch for the LMS algorithm fails

Check for specific LMS error

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

12 days agoDo not use RW mutexes on RISC-V arch
Bernd Edlinger [Fri, 19 Sep 2025 06:52:24 +0000 (08:52 +0200)] 
Do not use RW mutexes on RISC-V arch

For unknown reasons using RW mutexes on RISC-V arch
seems to be broken, at least with glibc.

Fixes #28550

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

12 days agoAdd Linux Foundation Health Score badge to README
Jonathan Reimer [Thu, 18 Sep 2025 15:32:41 +0000 (17:32 +0200)] 
Add Linux Foundation Health Score badge to README

CLA: trivial

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

12 days agox509: fix mem leak on error path
Nikola Pajkovsky [Mon, 22 Sep 2025 10:17:16 +0000 (12:17 +0200)] 
x509: fix mem leak on error path

The x509_store_add() creates X509_OBJECT wrapping either X509 or
X509_CRL. However, if you set the type to X509_LU_NONE before
X509_OBJECT_free then it skips the free on the wrapped type and just
calls OPENSSL_free on the object itself. Hence, leaking wrapped
object.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28631)

12 days agoRe-enable the ssl_trace_test()
Tomas Mraz [Sat, 20 Sep 2025 14:53:46 +0000 (16:53 +0200)] 
Re-enable the ssl_trace_test()

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

12 days agosslapitest.c: Skip test_ssl_trace() with FIPS providers older than 3.5
Tomas Mraz [Sat, 20 Sep 2025 14:52:07 +0000 (16:52 +0200)] 
sslapitest.c: Skip test_ssl_trace() with FIPS providers older than 3.5

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

12 days agotls_common.c: Handle inner content type properly on Big Endian
Tomas Mraz [Sat, 20 Sep 2025 14:45:50 +0000 (16:45 +0200)] 
tls_common.c: Handle inner content type properly on Big Endian

When passing the inner content type to msg_callback,
the lowest byte of rec->type needs to be passed instead
of directly passing the rec->type otherwise the value is
incorrect on Big Endian platforms.

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

12 days agoFix the abnormal branch memory leak in ssl_set_cert_and_key function
lan1120 [Fri, 19 Sep 2025 10:45:30 +0000 (18:45 +0800)] 
Fix the abnormal branch memory leak in ssl_set_cert_and_key function

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

12 days agoEnsure q variable is freed
Nikola Pajkovsky [Thu, 18 Sep 2025 06:56:44 +0000 (08:56 +0200)] 
Ensure q variable is freed

Fixes: d88c43a64408 ("Ensure that empty or 1 element stacks are always sorted.")
Resolves: https://scan5.scan.coverity.com/#/project-view/65138/10222?selectedIssue=1665465
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28596)

12 days agoCorrect version used to check for elf_aux_info() on FreeBSD
Brad Smith [Wed, 17 Sep 2025 03:16:48 +0000 (23:16 -0400)] 
Correct version used to check for elf_aux_info() on FreeBSD

FreeBSD also added elf_aux_info() to the 11 branch and was shipped
with 11.4.

https://github.com/freebsd/freebsd-src/commit/03444a7d439755189e4dc8ccd56403bbaef3d6b0

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

12 days agobio_ok.c: Integer Overflow in BIO_f_reliable record parser leads to Out-of-Bounds...
Luigino Camastra [Wed, 10 Sep 2025 10:13:11 +0000 (12:13 +0200)] 
bio_ok.c: Integer Overflow in BIO_f_reliable record parser leads to Out-of-Bounds Read

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

12 days agoAdded test suggested by Shane Lontis
Viktor Dukhovni [Mon, 22 Sep 2025 05:02:28 +0000 (15:02 +1000)] 
Added test suggested by Shane Lontis

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28624)

12 days agoHarden property put_str() helper corner case
Viktor Dukhovni [Sat, 20 Sep 2025 04:02:52 +0000 (14:02 +1000)] 
Harden property put_str() helper corner case

The put_str() helper of the internal ossl_property_list_to_string()
function failed to correctly check the remaining buffer length in a
corner case in which a property name or string value needs quoting,
and exactly one byte of unused space remained in the output buffer.

The only potentially affected calling code is conditionally compiled
(disabled by default) provider "QUERY" tracing that is executed only
when also requested at runtime.  An initial fragment of the property
list encoding would need to use up exactly 511 bytes, leaving just 1
byte for the next string which requires quoting.  Bug reported by

    Aniruddhan Murali (@ashamedbit)
    Noble Saji Mathews (@NobleMathews)

both from the University of Waterloo.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28624)

12 days agoAdd unsupported features in NOTES-C99.md: complex.h and variable length array
Richard Levitte [Thu, 18 Sep 2025 11:22:47 +0000 (13:22 +0200)] 
Add unsupported features in NOTES-C99.md: complex.h and variable length array

Resolves: https://github.com/openssl/openssl/issues/28598

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/28602)

2 weeks agoMake generated files read-only
Richard Levitte [Thu, 18 Sep 2025 15:12:33 +0000 (17:12 +0200)] 
Make generated files read-only

This is an attempt to discouraged manual changes of generated files,
as people have done so, just to get their changes over-written next
time those files are re-generated.

Reference: https://github.com/openssl/openssl/discussions/28269

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

2 weeks agoFix OPENSSL_VERSION_NUMBER to always have zero status bits
Richard Levitte [Thu, 18 Sep 2025 05:14:13 +0000 (07:14 +0200)] 
Fix OPENSSL_VERSION_NUMBER to always have zero status bits

The documentation suggested that they were always zero, while the
implementation in <openssl/opensslv.h> suggested that it could be
0xf in OpenSSL releases...  which (almost) never happened because
of a bug in said implementation.

Therefore, we solidify that the status bits are indeed always zero,
at least in all OpenSSL 3 versions.

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

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

2 weeks agoFix CI Pipeline by Disabling SSL_TRACE_TEST
Ryan Hooper [Fri, 19 Sep 2025 15:33:09 +0000 (11:33 -0400)] 
Fix CI Pipeline by Disabling SSL_TRACE_TEST

Disabling the SSL_TRACE_TEST since it caused an issue on
some cross compiles. A follow-on commit will change
the test.

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

2 weeks agoFix another memory order issue
Bernd Edlinger [Mon, 15 Sep 2025 19:12:37 +0000 (21:12 +0200)] 
Fix another memory order issue

this adds another release/acquire link between update_qp and
get_hold_current_qp via the reader_idx because the current
one which is based on the qp users count is only preventing
a race condition, but does not help when the reader acquires
the next qp.

Fixes #27267

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

2 weeks agoFix ML-KEM key equality check when either unset
Viktor Dukhovni [Tue, 16 Sep 2025 12:40:32 +0000 (22:40 +1000)] 
Fix ML-KEM key equality check when either unset

Fixes #28563

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

2 weeks agoRevert "rsa: expose pairwise consistency test API"
Eugene Syromiatnikov [Mon, 15 Sep 2025 20:55:59 +0000 (22:55 +0200)] 
Revert "rsa: expose pairwise consistency test API"

This reverts commit dc5cd6f70a0e "rsa: expose pairwise consistency test API",
that has introduced ossl_rsa_key_pairwise_test() function, as the only user
has been removed in 7f7f75816f26 "import pct: remove import PCTs for most
algorithms".

Complements: 7f7f75816f26 "import pct: remove import PCTs for most algorithms"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28557)

2 weeks agoFix cipher protocol ID type in docs
Grzesiek11 [Thu, 11 Sep 2025 15:13:48 +0000 (17:13 +0200)] 
Fix cipher protocol ID type in docs

The cipher protocol ID, the return type of SSL_CIPHER_get_protocol_id,
is uint16_t and correctly described in docs to be 2 bytes, however the
function signature on the same page incorrectly pointed to it being
uint32_t, which is 4 bytes.

CLA: trivial

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

2 weeks agoUpdated SSL Trace to display the name for all MLKEM-based groups
Ryan Hooper [Tue, 9 Sep 2025 14:43:51 +0000 (10:43 -0400)] 
Updated SSL Trace to display the name for all MLKEM-based groups

Make SSL Trace to display the name of the MLKEM512, MLKEM768,
MLKEM1024 and SecP384r1MLKEM1024 groups.

Fixes #28476

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

2 weeks agoEnable peer verification with s_server's verify_return_error option
Ryan Hooper [Thu, 28 Aug 2025 18:58:02 +0000 (14:58 -0400)] 
Enable peer verification with s_server's verify_return_error option

If the option is specified it will now implicitly enable peer verification.

The s_client command  was already behaved this way, so
s_server was updated to match the behavior of s_client.

Fixes #15134

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

2 weeks agodoc: clarify SSL_SESSION_get0_hostname() DESCRIPTION
Ritesh Kudkelwar [Thu, 11 Sep 2025 04:38:34 +0000 (10:08 +0530)] 
doc: clarify SSL_SESSION_get0_hostname() DESCRIPTION

Also refine RETURN VALUES.

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

2 weeks agoUse less preprocessor gymnastics for fatal error detection.
Bob Beck [Mon, 25 Aug 2025 20:26:33 +0000 (14:26 -0600)] 
Use less preprocessor gymnastics for fatal error detection.

We seem to be using a lot of preprocessor gymnastics to avoid
having duplicate cases in a case statement depending on what
the host system defines these values to.  We should not care.

If we don't bother with the case statement this becomes
easier to follow.

While we are here, pick up the reccomended windows2 values
that correspond with the POSIX values we already have
in here that we believe are "non-fatal", and condition
the codes to use on being windows or something POSIX.

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

2 weeks agotest/p_ossltest.c: check for return values in OSSL_PARAM_* calls
Eugene Syromiatnikov [Wed, 17 Sep 2025 10:41:58 +0000 (12:41 +0200)] 
test/p_ossltest.c: check for return values in OSSL_PARAM_* calls

Some of the OSSL_PARAM_* calls haven't their return codes checked
(OSSL_PARAM_get_octet_string_ptr() call
in ossl_test_aes128cbchmacsha1_set_ctx_params(),
and OSSL_PARAM_set_size_t() call in drbg_ctr_get_ctx_params()),
and Coverity complained about it.  Add the missing checks.

Fixes: 032297054ab5 "Implement an ossltest provider to replace ossltest engine"
Resolves: https://github.com/openssl/project/issues/1618
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665462
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665463
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
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/28583)

2 weeks agoproviders/implementations/keymgmt/ecx_kmgmt.c.in: remove PCT on ECX import
Eugene Syromiatnikov [Tue, 16 Sep 2025 14:25:33 +0000 (16:25 +0200)] 
providers/implementations/keymgmt/ecx_kmgmt.c.in: remove PCT on ECX import

While PCT on import has been removed for DH, EC, RSA, and SLH-DSA,
ECX seems to be overlooked.  Correct that omission.

Complements: 7f7f75816f26 "import pct: remove import PCTs for most algorithms"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28573)

2 weeks agocrypto/ml_dsa: fix public_from_private() error path to return failure
rodeka [Tue, 16 Sep 2025 17:38:17 +0000 (20:38 +0300)] 
crypto/ml_dsa: fix public_from_private() error path to return failure

The error label returned success (1) even on failure. Make it return failure (0) instead.
Fixes #28562

CLA: trivial

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

2 weeks agoDon't return a value we never check from indent_printf()
Bob Beck [Mon, 15 Sep 2025 17:52:44 +0000 (11:52 -0600)] 
Don't return a value we never check from indent_printf()

Coverity notices it could overflow, since we don't use this
don't bother returning it

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

2 weeks agoDon't clear is_sorted unconditionally on OPENSSL_sk_insert()
Bob Beck [Fri, 12 Sep 2025 18:08:02 +0000 (12:08 -0600)] 
Don't clear is_sorted unconditionally on OPENSSL_sk_insert()

If we have a comparison function, and the array was sorted,
check to see if we are inserting in the correct location.
if so do not clear is_sorted.

This allows for element locations found with OPENSSL_sk_find_ex
to be used to insert elements in the correct location and preserve
the sorting order without the need to sort the stack again.

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

2 weeks agoFix logic errors in torture_rw_high/low test
Bernd Edlinger [Tue, 16 Sep 2025 15:18:33 +0000 (17:18 +0200)] 
Fix logic errors in torture_rw_high/low test

"old" was never assigned anything and the first
assignment to "*iterations" in the loop was superfluous.

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

2 weeks agoEnsure that empty or 1 element stacks are always sorted.
Bob Beck [Wed, 10 Sep 2025 17:43:01 +0000 (11:43 -0600)] 
Ensure that empty or 1 element stacks are always sorted.

Matt noticed "It's kind of weird that we are forced to call sort on
a newly created and empty stack. It feels like an empty stack should
have the "sorted" flag by default on creation"

I am incluined to agree. This change ensures tht empty or 1 element
stacks are marked as sorted, as per the existing comment in the
file.

Since this involved changing the various duplication routines to
also ensure that sorted was preserved for such stacks, I also
noticed the duplication code was largely duplicated. I
took the opportunity to deduplicate the duplication code while
making these changes.

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

2 weeks ago25-test_verify.t: fix misleading test case names and file variable name
Dr. David von Oheimb [Mon, 8 Sep 2025 05:59:23 +0000 (07:59 +0200)] 
25-test_verify.t: fix misleading test case names and file variable name

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

2 weeks ago25-test_verify.t: fix partly case-sensitive matching for Windows OS: s/MsWin32/MSWin32/
Dr. David von Oheimb [Sat, 26 Jul 2025 08:46:21 +0000 (10:46 +0200)] 
25-test_verify.t: fix partly case-sensitive matching for Windows OS: s/MsWin32/MSWin32/

Fixes #27984

Reviewed-by: Matt Caswell <matt@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/28098)

2 weeks agoImplement Montgomery multiplication assembly optimization for RV64GC
fengpengbo [Thu, 14 Aug 2025 06:34:20 +0000 (14:34 +0800)] 
Implement Montgomery multiplication assembly optimization for RV64GC

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

2 weeks agoFix ossl_prov_set_macctx
Neil Horman [Fri, 12 Sep 2025 17:11:46 +0000 (13:11 -0400)] 
Fix ossl_prov_set_macctx

This function fails to construct a param list that includes the passed
in property query string in the param lists when allocating subordonate
algorithms.

Make sure we allow callers to pass a param list (so that providers for
subordonate algorithms can be selected), and merge those into the param
list that this function builds on its own.

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

2 weeks agosupport passing prop querys to composite algs
Neil Horman [Tue, 9 Sep 2025 13:47:34 +0000 (09:47 -0400)] 
support passing prop querys to composite algs

We have several composite alg usages (i.e. MAC/KDF) which pick the right
digest implementation when using an engine, but fail to get the right
one when using a provider because we don't pass the propquery in a
parameter to their instantiation.

Fix them up by constructing the appropriate parameters

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

2 weeks agoremove loader_attic test from test_cmp_cli
Neil Horman [Thu, 4 Sep 2025 20:14:21 +0000 (16:14 -0400)] 
remove loader_attic test from test_cmp_cli

This engine is going away (in fact they all are), so just remove the
test cases referencing this engine

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

2 weeks agoremove loader_attic tests from test_store
Neil Horman [Thu, 4 Sep 2025 20:12:20 +0000 (16:12 -0400)] 
remove loader_attic tests from test_store

With the removal of engines we need to handle the loader_attic test that
will fail with said removal

based on the advice of @levitte, given that we have a file: loader in
the default provider already, theres no need to test an engine thats
going away, so just remove it.

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

2 weeks agoConvert TLSProxy to use new provider
Neil Horman [Thu, 4 Sep 2025 18:04:55 +0000 (14:04 -0400)] 
Convert TLSProxy to use new provider

replace use of ossltest engine with provider in TLSProxy and update all
dependent tests

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

2 weeks agoreplace ossltest engine in test_dgst
Neil Horman [Thu, 4 Sep 2025 17:45:22 +0000 (13:45 -0400)] 
replace ossltest engine in test_dgst

Use the new ossltest provider rather than the ossltest engine

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

2 weeks agoConvert test_rand to use our new p_ossltest provider
Neil Horman [Thu, 4 Sep 2025 17:44:30 +0000 (13:44 -0400)] 
Convert test_rand to use our new p_ossltest provider

Replace ossltest engine with ossltest provider in test_rand

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

2 weeks agoImplement an ossltest provider to replace ossltest engine
Neil Horman [Tue, 26 Aug 2025 12:08:01 +0000 (08:08 -0400)] 
Implement an ossltest provider to replace ossltest engine

Part of the effort to remove engines creates a problem for our test
suite, in that we have a large number of tests that rely on the use of a
test engine (ossltest), which implements the aes-128-cbc, aes-128-gcm,
aes-128-cbc-hmac-sha1 ciphers, several digests and a random number
generator to produce predictable outputs for the purposes of doing
testing against known values.

Since we're getting rid of engines, these tests need to be updated to
use a provider that presents the same functionality.

This commit implements that provider.

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

2 weeks agoAdd OSSL_ prefix back onto param names
Pauli [Fri, 12 Sep 2025 09:03:12 +0000 (19:03 +1000)] 
Add OSSL_ prefix back onto param names

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

2 weeks agoCHANGES.md, NEWS.md: update for 3.6.0-beta1
Eugene Syromiatnikov [Thu, 11 Sep 2025 14:59:55 +0000 (16:59 +0200)] 
CHANGES.md, NEWS.md: update for 3.6.0-beta1

CHANGES.md:
 * https://github.com/openssl/openssl/pull/28398
 * https://github.com/openssl/openssl/pull/28411
 * https://github.com/openssl/openssl/pull/28447
 * https://github.com/openssl/openssl/pull/28449

NEWS.md:
 * https://github.com/openssl/openssl/pull/28447

Release: yes
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28547)

2 weeks agoCHANGES.md, NEWS.md: ffix
Eugene Syromiatnikov [Thu, 11 Sep 2025 14:59:29 +0000 (16:59 +0200)] 
CHANGES.md, NEWS.md: ffix

Minor formating cleanups.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28547)

2 weeks agocrypto/ec/ecp_nistz256.c: use OPENSSL_aligned_alloc_array
Eugene Syromiatnikov [Mon, 18 Aug 2025 12:32:32 +0000 (14:32 +0200)] 
crypto/ec/ecp_nistz256.c: use OPENSSL_aligned_alloc_array

Allocate table in ecp_nistz256_windowed_mul() and preComputedTable
in ecp_nistz256_mult_precompute() using OPENSSL_aligned_alloc_array() call
instead of OPENSSL_malloc with a 64-byte slack and manual pointer alignment
adjustement.

Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agoExplicitly limit the OPENSSL_aligned_alloc()'s alignment to 65536
Eugene Syromiatnikov [Thu, 28 Aug 2025 14:43:13 +0000 (16:43 +0200)] 
Explicitly limit the OPENSSL_aligned_alloc()'s alignment to 65536

There is little need to support alignments larger than a page size,
and the open-coded OPENSSL_aligned_alloc() implementation implements
that support in quite wasteful manner, so it is better just to limit
the maximum supported alignment explicitly.  The value of 65536
has been chosen so it is architecture-agnostic and is no less than page sizes
used in commonly occurring architectures (and also it is a pretty number).

Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agocrypto/mem.c: use open-coded aligned alloc when posix_memalign fails
Eugene Syromiatnikov [Thu, 28 Aug 2025 13:55:29 +0000 (15:55 +0200)] 
crypto/mem.c: use open-coded aligned alloc when posix_memalign fails

While posix_memalign() is generally not expected to fail, we can always use
the internal aligned alloc implementation to ensure that any
OPENSSL_aligned_malloc failure is indeed fatal and does not require
a fallback.

Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agoMove the open-coded aligned alloc in a separate file and use it in FIPS module
Eugene Syromiatnikov [Mon, 18 Aug 2025 12:24:23 +0000 (14:24 +0200)] 
Move the open-coded aligned alloc in a separate file and use it in FIPS module

Factor the open-coded aligned allocation implementation in a separate
file and use it instead of just returning NULL in CRYPTO_aligned_alloc
implementation in the FIPS provider.

Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agoMove OPENSSL_SMALL_FOOTPRINT-related logic from aligned_alloc to the only caller
Eugene Syromiatnikov [Mon, 18 Aug 2025 11:38:56 +0000 (13:38 +0200)] 
Move OPENSSL_SMALL_FOOTPRINT-related logic from aligned_alloc to the only caller

Originally, CRYPTO_aligned_alloc() returned NULL if OpenSSL was built
with OPENSSL_SMALL_FOOTPRINT defined, which is a weird place for such
a consideration;  moreover it means that every caller requires to
implement some form of a fallback (and manually over-allocate
and then align the returned memory if the alignment is a requirement),
which is counter-productive (and outright ridiculous in environments
with posix_memalign() available).  Move the OPENSSL_SMALL_FOOTPRINT
consideration to the only current caller and update the documentation
and tests accordingly.

Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agodoc/man3/OPENSSL_malloc.pod: size is no longer needed to be alignment multiple
Eugene Syromiatnikov [Thu, 28 Aug 2025 14:37:19 +0000 (16:37 +0200)] 
doc/man3/OPENSSL_malloc.pod: size is no longer needed to be alignment multiple

While the commit 648803a17e4c1 "crypto/mem.c: don't use aligned_alloc
in CRYPTO_aligned_alloc" removed the aligned_alloc() usage
along with its overly onerous requirements, its author failed to update
the documentation accordingly.  Correct that omission by removing
the requirement from the DESCRIPTION and adding a relevant mention
in HISTORY.

Complements: 648803a17e4c1 "crypto/mem.c: don't use aligned_alloc in CRYPTO_aligned_alloc"
Signed-off-by: Eugene Syromiatnikov <esyr@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/28295)

2 weeks agotest/radix/terp.c: avoid accessing uninitialised terp on error
Eugene Syromiatnikov [Mon, 15 Sep 2025 03:27:58 +0000 (05:27 +0200)] 
test/radix/terp.c: avoid accessing uninitialised terp on error

Stats printing in TERP_run() assumes that terp has been initialised,
which is not the case when a jump to the err label has been performed
before successful TERP_init() call;  avoid it by emplacing it
within a have_terp guard check.

Fixes: 4a2d5fe812f8 "QUIC RADIX: Add RADIX test framework implementation"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665430
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

2 weeks agoapps/storeutl.c: avoid signed integer overflow in indent_printf()
Eugene Syromiatnikov [Mon, 15 Sep 2025 03:14:09 +0000 (05:14 +0200)] 
apps/storeutl.c: avoid signed integer overflow in indent_printf()

As two arbitrarily large printf return value can trigger function
overflow, rewrite the return value handling to avoid it.

Fixes: fb43ddceda79 "Add a recursive option to 'openssl storeutl'"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665428
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

2 weeks agocrypto/evp/ctrl_params_translate.c: fix a typo in the error message
Eugene Syromiatnikov [Mon, 15 Sep 2025 03:05:01 +0000 (05:05 +0200)] 
crypto/evp/ctrl_params_translate.c: fix a typo in the error message

The ERR_raise_data() call on failure to find ctx->p2 in str_value_map
erroneously refers to ctx->p1 instead;  fix that but supplying the
correct field and casting it to the supposed const char * type.

Fixes: 9a1c4e41e8d3 "EVP: Implement data-driven translation between known ctrl and OSSL_PARAMs"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665427
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

2 weeks agocrypto/bio/bss_file.c: add missing cast in format arg in ERR_raise_data()
Eugene Syromiatnikov [Mon, 15 Sep 2025 02:44:36 +0000 (04:44 +0200)] 
crypto/bio/bss_file.c: add missing cast in format arg in ERR_raise_data()

"%s" conversion specifier requires a "char *" argument, so ptr needs
to be cast to it there, as Coverity has noted.

Fixes: ff988500c2f39 "Replace FUNCerr with ERR_raise_data"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665423
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

2 weeks agotest/wpackettest.c: remove ubogus cleanup() in test_WPACKET_quic_vlint_random()
Eugene Syromiatnikov [Mon, 15 Sep 2025 02:05:04 +0000 (04:05 +0200)] 
test/wpackettest.c: remove ubogus cleanup() in test_WPACKET_quic_vlint_random()

In the beginning of the iteration, pkt is not initialised yet, so there is
no need to clean it up on RAND_bytes() failure.  Replace "return cleanup(&pkt)"
with plain "return 0"'

Fixes: 416d0a638c16 "QUIC wire format support"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665422
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

2 weeks agocrypto/x509/t_x509.c: check i2d_X509_NAME() return value in X509_ocspid_print()
Eugene Syromiatnikov [Mon, 15 Sep 2025 01:31:31 +0000 (03:31 +0200)] 
crypto/x509/t_x509.c: check i2d_X509_NAME() return value in X509_ocspid_print()

There is little reason for this call to fail, but there is also little
reason for not to check for it, and, since Coverity noticed
that the check is missing, just add it.

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665420
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28546)

3 weeks agoEnable LMS on provider compat fips build for 3.6
Neil Horman [Sun, 14 Sep 2025 17:13:00 +0000 (13:13 -0400)] 
Enable LMS on provider compat fips build for 3.6

The LMS test for fips assumes that LMS is available in the provider in
any version equal to or later than 3.6.

We should probably augment the test such that instead of just checking
the openssl version, we instead query the provider to see if the needed
algs are available to use LMS.

But given the current state of affairs, it seems more sensible to just
enable lms in the 3.6 fips provider build to ensure lms gets tested.

Fixes openssl/project#1435

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