]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
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)

3 weeks agoTest failure of rsa_encrypt when buffer too short
Viktor Dukhovni [Sat, 13 Sep 2025 02:52:42 +0000 (12:52 +1000)] 
Test failure of rsa_encrypt when buffer too short

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

3 weeks agoHarden RSA public encrypt
Viktor Dukhovni [Thu, 11 Sep 2025 08:50:44 +0000 (18:50 +1000)] 
Harden RSA public encrypt

Check the that the indicated output buffer length is large enough.

Fix EVP_SealInit() to initialise the output buffer length to the RSA
modulus length, not the input KEK length.

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

3 weeks agoUpdate our CI jobs to cover the 3.6 stable branch
Neil Horman [Thu, 11 Sep 2025 12:40:14 +0000 (08:40 -0400)] 
Update our CI jobs to cover the 3.6 stable branch

The coveralls, prov-compat and provider-compatibiity CI jobs test each
of the stable branches.  We need to add 3.6 to the list in each of those
tests

Fixes openssl/project#1424

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
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/28519)

3 weeks agokmac_prov.c.in: avoid resource leak on kmac_new_decoder fail in kmac_fetch_new
Eugene Syromiatnikov [Wed, 10 Sep 2025 23:34:12 +0000 (01:34 +0200)] 
kmac_prov.c.in: avoid resource leak on kmac_new_decoder fail in kmac_fetch_new

kctx was not freed in a case of kmac_new_decoder failure;  consolidate
all the error paths under the "err:" label and jump to it on kmac_new_decoder()
returning 0.

Fixes: d5efc853796b "kmac: avoid using ossl_prov_digest_load_from_params()"
Resolves: https://github.com/openssl/project/issues/1419
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1453634
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28516)

3 weeks agotest/bioprinttest.c: silence more width/precision checks
Eugene Syromiatnikov [Fri, 12 Sep 2025 15:57:50 +0000 (17:57 +0200)] 
test/bioprinttest.c: silence more width/precision checks

Apparently, old glibc also can't handle width/precision specifiers;
silence the checks that test for it by setting .skip_libc_check to 1.

Fixes: a29d157fdb6d "Replace homebrewed implementation of *printf*() functions with libc"
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/28530)

3 weeks agoremove test_big() the return value we compare varies between
sashan [Thu, 11 Sep 2025 19:25:30 +0000 (21:25 +0200)] 
remove test_big() the return value we compare varies between
libc implementations. removing this test makes test suite
more rubust.

Fixes a29d157fdb6d

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

3 weeks agoReplace homebrewed implementation of *printf*() functions with libc
sashan [Fri, 11 Apr 2025 20:42:08 +0000 (22:42 +0200)] 
Replace homebrewed implementation of *printf*() functions with libc

Switching from ANSI-C we can use implementation of printf like
function provided by libc on target platform. This applies
starting from 3.6 and onwards.

The slight exception here is old windows printf functions
before 2015, those are supported.

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

3 weeks agocrmf_lib.c create_popo_signature(): add error queue entry on signature failure
Dr. David von Oheimb [Mon, 2 Jun 2025 18:58:01 +0000 (20:58 +0200)] 
crmf_lib.c create_popo_signature(): add error queue entry on signature failure

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

3 weeks agoCHANGES.md: add entry on constifying (X509) function parameter
Dr. David von Oheimb [Mon, 8 Sep 2025 09:38:04 +0000 (11:38 +0200)] 
CHANGES.md: add entry on constifying (X509) function parameter

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

3 weeks agocrypto: remove OSSL_FUTURE_CONST as it is not more needed since 4.0
Dr. David von Oheimb [Mon, 8 Sep 2025 09:29:46 +0000 (11:29 +0200)] 
crypto: remove OSSL_FUTURE_CONST as it is not more needed since 4.0

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

3 weeks agoconstify X509_*print*(), X509_get0_*_objects(), X509_*_get0(), ..., effectively in...
Dr. David von Oheimb [Fri, 7 Feb 2025 11:34:25 +0000 (12:34 +0100)] 
constify X509_*print*(), X509_get0_*_objects(), X509_*_get0(), ..., effectively in OpenSSL 4.0

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

3 weeks agoconstify X509_REQ_get_X509_PUBKEY() in OpenSSL 4.0; related fixes in doc, x509.h...
Dr. David von Oheimb [Fri, 7 Feb 2025 11:05:05 +0000 (12:05 +0100)] 
constify X509_REQ_get_X509_PUBKEY() in OpenSSL 4.0; related fixes in doc, x509.h.in, x509_req.c

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

3 weeks agorename FFC_PARAM_PTRS to FFC_OSSL_PARAMS
Pauli [Mon, 8 Sep 2025 06:33:27 +0000 (16:33 +1000)] 
rename FFC_PARAM_PTRS to FFC_OSSL_PARAMS

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

3 weeks agodsa/dh: update keymanagers for DH and DSA to use generated param parsers
Pauli [Thu, 28 Aug 2025 01:49:44 +0000 (11:49 +1000)] 
dsa/dh: update keymanagers for DH and DSA to use generated param parsers

Both are updates to reduce the OSSL_PARAM_locate related searching.

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

3 weeks agoAdd invalid parameter error to parser generator
Pauli [Thu, 28 Aug 2025 01:49:40 +0000 (11:49 +1000)] 
Add invalid parameter error to parser generator

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

3 weeks agodh/dsa: rename files in anticipation of using generated param name parsers
Pauli [Mon, 25 Aug 2025 23:06:49 +0000 (09:06 +1000)] 
dh/dsa: rename files in anticipation of using generated param name parsers

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

3 weeks agoOSSL_CALLBACK.pod: add missing info on required return values of callback functions
Dr. David von Oheimb [Mon, 14 Apr 2025 19:09:16 +0000 (21:09 +0200)] 
OSSL_CALLBACK.pod: add missing info on required return values of callback functions

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

3 weeks agodoc: Add missing commas
Jakub Jelen [Tue, 9 Sep 2025 16:10:30 +0000 (18:10 +0200)] 
doc: Add missing commas

CLA: trivial
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28493)

3 weeks agoDoc changes: the -hmac-env and -hmac-stdin options of openssl-dgst
Igor Ustinov [Tue, 9 Sep 2025 19:50:01 +0000 (21:50 +0200)] 
Doc changes: the -hmac-env and -hmac-stdin options of openssl-dgst
will appear in version 4.0

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

3 weeks agom_sigver.c do_sigver_init(): add details to EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KE...
Dr. David von Oheimb [Mon, 2 Jun 2025 19:01:50 +0000 (21:01 +0200)] 
m_sigver.c do_sigver_init(): add details to EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE

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

3 weeks agoEVP_PKEY_CTX_get_params(): add error queue entry EVP_R_PROVIDER_GET_CTX_PARAMS_NOT_SU...
Dr. David von Oheimb [Mon, 2 Jun 2025 19:00:49 +0000 (21:00 +0200)] 
EVP_PKEY_CTX_get_params(): add error queue entry EVP_R_PROVIDER_GET_CTX_PARAMS_NOT_SUPPORTED

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

3 weeks agoAdd one more trace message to the torture_rcu_high test
Bernd Edlinger [Mon, 8 Sep 2025 21:00:55 +0000 (23:00 +0200)] 
Add one more trace message to the torture_rcu_high test

It is interesting that in the very rare cases, where this
test failure has been observed so far, the rcu torture value
went always backwards to 0.  This could be either due to
ossl_rcu_deref(&writer_ptr) returning NULL, or the initial
value of "new = CRYPTO_zalloc(sizeof(uint64_t), NULL, 0)"
still visible despite ossl_rcu_assign_ptr(&writer_ptr, &new)
immediatley after the "*new = global_ctr++" statement.
Add one additional trace message to find out what exactly
happens here, when it happens again.
Additionally, we do no longer initialize the new value to
zero but something else, so it can also be detected.

Related to #27267

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

3 weeks agoAdd key_type to the derive_skey function
Dmitry Belyavskiy [Mon, 8 Sep 2025 18:50:59 +0000 (20:50 +0200)] 
Add key_type to the derive_skey function

In some cases this information is necessary on the provider side

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

3 weeks agodoc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1
Eugene Syromiatnikov [Fri, 29 Aug 2025 08:29:26 +0000 (10:29 +0200)] 
doc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1

Mention that RAND_load_file attempts to read only RAND_DRBG_STRENGTH
bytes on non-regular files if the number of bytes to be read
is not specified explicitly.

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

3 weeks agocrypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file
Eugene Syromiatnikov [Fri, 29 Aug 2025 08:02:39 +0000 (10:02 +0200)] 
crypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file

If a file supplied to RAND_load_file is too big (more than INT_MAX bytes),
it is possible to trigger a signer integer overflow during ret calculation.
Avoid it by returning early when we are about to hit it on the next
iteration.

Reported-by: Liu-Ermeng <liuermeng2@huawei.com>
Resolves: https://github.com/openssl/openssl/issues/28375
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28379)

3 weeks agoutil/find-doc-nits: do not check files in submodules in check_env_vars
Eugene Syromiatnikov [Fri, 29 Aug 2025 07:11:23 +0000 (09:11 +0200)] 
util/find-doc-nits: do not check files in submodules in check_env_vars

The reports about undocumented environment variables coming from files
in submodules are superfluous;  get the list of directories
from .gitmodules and exclude them from processing.

Resolves: https://github.com/openssl/openssl/issues/28109
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28378)

3 weeks agoMake the Unix build process more repeatable
Enji Cooper [Fri, 5 Sep 2025 03:22:00 +0000 (20:22 -0700)] 
Make the Unix build process more repeatable

Before this change all manpages would contain the date when pod2man was
run. This resulted in outputs that differed between builds--or
potentially across a single build if the host clock "ticked" to the next
day when the build was being run.

This commit modifies the manpage generation process as follows:
- The date all manpages were generated will be normalized to a single
  date.
- The release date specified in `VERSION.dat` is used instead of the
  date/time when `pod2man` was executed OR--in the event a date isn't
  specified in `VERSION.dat`--the time when the Makefiles were last
  regenerated.

Embedding a consistent date into the generated manpages helps ensure that
the build process as a whole is more repeatable and helps ensure that
release versions of OpenSSL create artifacts consistent with the date
that the official release was cut.

Co-authored-by: Richard Levitte <levitte@openssl.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28449)

3 weeks agoopenssl-enc.pod.in: We actually use PKCS#7 padding
Sergey G. Brester [Wed, 27 Aug 2025 22:26:11 +0000 (00:26 +0200)] 
openssl-enc.pod.in: We actually use PKCS#7 padding

PKCS#5 padding is a subset for 8-bytes block ciphers only.

CLA: trivial

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

3 weeks agogithub/workflows: Replace deprecated apt-get --force-yes
Norbert Pocs [Thu, 4 Sep 2025 08:02:55 +0000 (10:02 +0200)] 
github/workflows: Replace deprecated apt-get --force-yes

It is replaced by a few flags starting with '--allow-'. Currently:
--allow-unauthenticated
--allow-downgrades
--allow-remove-essential
--allow-change-held-packages

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

3 weeks agoRISC-V: Use address for vlenb CSR
Hongren Zheng [Tue, 2 Sep 2025 14:00:10 +0000 (22:00 +0800)] 
RISC-V: Use address for vlenb CSR

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

3 weeks agoAdd a helper function to delete the extension list
David Benjamin [Sun, 31 Aug 2025 22:09:52 +0000 (18:09 -0400)] 
Add a helper function to delete the extension list

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

3 weeks agoClear the extension list when removing the last extension
David Benjamin [Sun, 31 Aug 2025 21:25:40 +0000 (17:25 -0400)] 
Clear the extension list when removing the last extension

The extensions list in a certificate, CRL, and CRL entry is defined as:

    ... extensions      [3]  EXPLICIT Extensions OPTIONAL ...
    ... crlEntryExtensions      Extensions OPTIONAL ...
    ... crlExtensions           [0]  EXPLICIT Extensions OPTIONAL ...

    Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension

This means that a present but empty extensions list is actually invalid.
Rather, if you have no extensions to encode, you are meant to omit the
list altogether. Fix the delete_ext functions to handle this correctly.

This would mostly be moot, as an application adding extensions only to
delete them all would be unusual. However, #13658 implemented a slightly
roundabout design where, to omit SKID/AKID, the library first puts them
in and then the command-line tool detects some placeholder values and
deletes the extension again.

Fixes #28397

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

3 weeks agoFix typo in BN_generate_prime docs
Viperinius [Sun, 31 Aug 2025 16:09:11 +0000 (16:09 +0000)] 
Fix typo in BN_generate_prime docs

CLA: trivial

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

3 weeks agoupdate compiler-zoo github actions workflow
Dmitry Misharov [Thu, 28 Aug 2025 13:54:54 +0000 (15:54 +0200)] 
update compiler-zoo github actions workflow

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

3 weeks agodoc: Update documentation of SSL_CTX_set_dh_auto()
Ryan Hooper [Thu, 28 Aug 2025 13:12:39 +0000 (09:12 -0400)] 
doc: Update documentation of SSL_CTX_set_dh_auto()

Update the documentation of the dh_tmp_auto argument in
regards to its behavior when the argument value is 2.

Fixes #27606

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

3 weeks agodocs: Be case specific with links to man headers
Norbert Pocs [Wed, 27 Aug 2025 13:45:45 +0000 (15:45 +0200)] 
docs: Be case specific with links to man headers

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
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/28356)

3 weeks agoremove ossl_prov_cipher_load_from_params()
Pauli [Thu, 28 Aug 2025 04:50:50 +0000 (14:50 +1000)] 
remove ossl_prov_cipher_load_from_params()

This function is no longer used or needed and it's internal so it can be
removed safely.

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

3 weeks agolegacy mac: convert to generated param name decoding
Pauli [Mon, 25 Aug 2025 05:50:41 +0000 (15:50 +1000)] 
legacy mac: convert to generated param name decoding

Also fix a mismatch between advertised settables and what was actually
processed.

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

3 weeks agolegacy mac: rename files to enable generated param decoders
Pauli [Mon, 25 Aug 2025 05:48:02 +0000 (15:48 +1000)] 
legacy mac: rename files to enable generated param decoders

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

3 weeks agodgst and mac apps: Added new ways for obtaining a MAC key
Igor Ustinov [Sat, 2 Aug 2025 16:53:13 +0000 (19:53 +0300)] 
dgst and mac apps: Added new ways for obtaining a MAC key

Resolves #24584

It is now possible to obtain a MAC key from an environment variable,
a file or read it from the standard input.

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

3 weeks agoFix unnecessary casts between int and size_t
Frederik Wedel-Heinen [Thu, 16 Jan 2025 09:27:31 +0000 (10:27 +0100)] 
Fix unnecessary casts between int and size_t

Also update a check for a negative int length value
in mem_write().

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

3 weeks agoX509_STORE_CTX_new.pod: change 'trust value' to 'trust id'
Dr. David von Oheimb [Mon, 9 Dec 2024 21:07:33 +0000 (22:07 +0100)] 
X509_STORE_CTX_new.pod: change 'trust value' to 'trust id'

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

3 weeks agox509_vfy.c: extend documenting comment for X509_STORE_CTX_purpose_inherit()
Dr. David von Oheimb [Mon, 9 Dec 2024 21:03:30 +0000 (22:03 +0100)] 
x509_vfy.c: extend documenting comment for X509_STORE_CTX_purpose_inherit()

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

3 weeks agox509_trust.c: add documenting comment for obj_trust()
Dr. David von Oheimb [Mon, 9 Dec 2024 21:02:58 +0000 (22:02 +0100)] 
x509_trust.c: add documenting comment for obj_trust()

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

3 weeks agoX509_STORE_CTX_purpose_inherit(): replace magic constant '0' by 'X509_TRUST_DEFAULT'
Dr. David von Oheimb [Sat, 7 Dec 2024 18:00:46 +0000 (19:00 +0100)] 
X509_STORE_CTX_purpose_inherit(): replace magic constant '0' by 'X509_TRUST_DEFAULT'

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

3 weeks ago25-test_verify.t: add test for trusted root excluding key usage KeyCertSign
Dr. David von Oheimb [Tue, 21 Mar 2023 13:21:45 +0000 (14:21 +0100)] 
25-test_verify.t: add test for trusted root excluding key usage KeyCertSign

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

3 weeks agoopenssl-verification-options.pod: improve description of certificate validation
Dr. David von Oheimb [Tue, 28 Feb 2023 11:10:35 +0000 (12:10 +0100)] 
openssl-verification-options.pod: improve description of certificate validation

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

3 weeks agoopenssl-verification-options.pod: better explain trust anchors and chain building
Dr. David von Oheimb [Sat, 9 Jul 2022 11:20:06 +0000 (13:20 +0200)] 
openssl-verification-options.pod: better explain trust anchors and chain building

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

3 weeks agoopenssl-verification-options.pod: Move reference to changes brought by OpenSSL 1...
Dr. David von Oheimb [Sat, 26 Jun 2021 13:50:34 +0000 (15:50 +0200)] 
openssl-verification-options.pod: Move reference to changes brought by OpenSSL 1.1.0 to HISTORY section

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

3 weeks agoasn1_parse.c: Fixed typo in comment
Pkeane22 [Sun, 7 Sep 2025 21:09:27 +0000 (17:09 -0400)] 
asn1_parse.c: Fixed typo in comment

Changed "15" to "14" on the comment line in ASN1_tag2str.

CLA: trivial

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

3 weeks agoapps: remove chopup_args()
Eugene Syromiatnikov [Thu, 4 Sep 2025 14:37:02 +0000 (16:37 +0200)] 
apps: remove chopup_args()

The last (and only?) user has been removed in commit eca471391378 "APPS:
Drop interactive mode in the 'openssl' program".

Complements: eca471391378 "APPS: Drop interactive mode in the 'openssl' program"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28441)

3 weeks agoAdd SM2 implementation in generic riscv64 asm
geliyaz [Wed, 2 Jul 2025 07:33:08 +0000 (15:33 +0800)] 
Add SM2 implementation in generic riscv64 asm

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

4 weeks agoapps: use app_malloc_array()
Eugene Syromiatnikov [Thu, 4 Sep 2025 15:59:33 +0000 (17:59 +0200)] 
apps: use app_malloc_array()

Replace app_malloc() calls where app_malloc_array() ones where
appropriate.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28444)

4 weeks agoapps: introduce app_malloc_array()
Eugene Syromiatnikov [Thu, 4 Sep 2025 15:57:18 +0000 (17:57 +0200)] 
apps: introduce app_malloc_array()

Similar to app_malloc(), provides a wrapper for OPENSSL_malloc_array()
that bails out when a NULL pointer is returned.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28444)

4 weeks agohmac: stop using secure memory for the HMAC key
Pauli [Mon, 1 Sep 2025 22:48:06 +0000 (08:48 +1000)] 
hmac: stop using secure memory for the HMAC key

Secure memory is design for long term storage of private material.
HMAC keys are not this.

Secure memory use was introduced in July 2020 by commit
3fddbb264e87a8cef2903cbd7b02b8e1a39a2a99.

Fixes #28346

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

4 weeks agoslh-dsa: omit test of import PCT
Pauli [Thu, 4 Sep 2025 21:24:19 +0000 (07:24 +1000)] 
slh-dsa: omit test of import PCT

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

4 weeks agoimport pct: remove import PCTs for most algorithms
Pauli [Thu, 4 Sep 2025 21:23:28 +0000 (07:23 +1000)] 
import pct: remove import PCTs for most algorithms

This coveres DH, EC, RSA and SLH-DSA.

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

4 weeks agointerop-test.yml: Install new openssl version alongside the old
Tomas Mraz [Fri, 5 Sep 2025 10:14:31 +0000 (12:14 +0200)] 
interop-test.yml: Install new openssl version alongside the old

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

4 weeks agointerop-tests.yml: Fix also the soversion in the RPM spec file
Tomas Mraz [Fri, 5 Sep 2025 07:20:11 +0000 (09:20 +0200)] 
interop-tests.yml: Fix also the soversion in the RPM spec file

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

4 weeks agoOnly unlock in rsa_get_blinding when locking was successful
two-heart [Thu, 4 Sep 2025 10:20:53 +0000 (12:20 +0200)] 
Only unlock in rsa_get_blinding when locking was successful

CLA: trivial

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

4 weeks agoAdd missing unlock to ossl_provider_new
two-heart [Thu, 4 Sep 2025 09:18:01 +0000 (11:18 +0200)] 
Add missing unlock to ossl_provider_new

unlock on the early return path

CLA: trivial

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

4 weeks agoRefactor cache_objects() loop and object type handling
olszomal [Tue, 2 Sep 2025 10:02:36 +0000 (12:02 +0200)] 
Refactor cache_objects() loop and object type handling

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

4 weeks agoUpdate the test for debuginfo
Matt Caswell [Wed, 3 Sep 2025 07:53:21 +0000 (08:53 +0100)] 
Update the test for debuginfo

Ensure we are testing against libcrypto.so.4

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

4 weeks agoSkip pyca cryptography tests for now
Matt Caswell [Tue, 2 Sep 2025 14:59:13 +0000 (15:59 +0100)] 
Skip pyca cryptography tests for now

These tests fail because they are not compatible with 4.0

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

4 weeks agoFix the doc-nits history check
Matt Caswell [Tue, 2 Sep 2025 14:37:53 +0000 (15:37 +0100)] 
Fix the doc-nits history check

Fix the script now that we are at version 4.0

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

4 weeks agoMake update following 4.0 version change
Matt Caswell [Tue, 2 Sep 2025 14:22:37 +0000 (15:22 +0100)] 
Make update following 4.0 version change

Update the ordinal numbers

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

4 weeks agoThe next version to be released from master is 4.0
Matt Caswell [Tue, 2 Sep 2025 14:06:48 +0000 (15:06 +0100)] 
The next version to be released from master is 4.0

Now that the 3.6 branch has been created, correct the master branch so
that it is clear that the next release from that branch will be 4.0

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

4 weeks agotls: explicitly clear the secure extensions on free
Pauli [Tue, 2 Sep 2025 02:30:00 +0000 (12:30 +1000)] 
tls: explicitly clear the secure extensions on free

Secure memory clears anyway but best to be explicit about it.

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

4 weeks agoX509_VERIFY_PARAM_get0(): add check to defend on out-of-bound table access
Dr. David von Oheimb [Thu, 28 Aug 2025 16:33:06 +0000 (18:33 +0200)] 
X509_VERIFY_PARAM_get0(): add check to defend on out-of-bound table access

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

4 weeks agodemos/certs: properly handle "$@"
Eugene Syromiatnikov [Mon, 1 Sep 2025 14:45:25 +0000 (16:45 +0200)] 
demos/certs: properly handle "$@"

There is little reason $@ should be used unquoted;  also, "$@"
should be used instead of $* in order to pass the script arguments
to a function.

Fixes: bcd92754d56a "demos: fix cert scripts"
Fixes: 79b184fb4b65 "Extend certificate creation examples to include CRL generation and sample"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agoapps/ocsp.c: avoid using NULL resp
Eugene Syromiatnikov [Mon, 1 Sep 2025 14:42:15 +0000 (16:42 +0200)] 
apps/ocsp.c: avoid using NULL resp

There are some code paths where resp is used without a previous check
for being non-NULL (specifically, OCSP_response_create() can return
NULL, and do_responder() can return -1, that would also lead to resp
being NULL).  Avoid hitting NULL dereferences by wrapping the code that
uses resp in "if (resp != NULL)".

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665155
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agocrypto/x509/t_req.c: avoid exts leaking on error paths
Eugene Syromiatnikov [Mon, 1 Sep 2025 14:34:34 +0000 (16:34 +0200)] 
crypto/x509/t_req.c: avoid exts leaking on error paths

If an error occurred and jump to the "err" label is performed after
exts has been allocated, it can leak.  Avoid that by adding
sk_X509_EXTENSION_pop_free() on the error path and setting exts to NULL
after sk_X509_EXTENSION_pop_free() in the normal handling.

Fixes: ae880ae6719e "Fix error handling in X509_REQ_print_ex"
Fixes: 87c49f622e7f "Support for parsing of certificate extensions in PKCS#10 requests: these are"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665161
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agotest/radix/quic_bindings.c: move locking after child_script_info assignment
Eugene Syromiatnikov [Mon, 1 Sep 2025 12:38:10 +0000 (14:38 +0200)] 
test/radix/quic_bindings.c: move locking after child_script_info assignment

Coverity complains that some child_script_info field accesses are guarded
by the mutexes, while others are not;  placate it by performing the assignment
before taking the lock.

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665151
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agodoc/man1/openssl-enc.pod.in: document 'k' handling for -bufsize
Eugene Syromiatnikov [Mon, 1 Sep 2025 12:08:08 +0000 (14:08 +0200)] 
doc/man1/openssl-enc.pod.in: document 'k' handling for -bufsize

Apparently, '-bufsize' option parser can handle the 'k' suffix
(and treat is as the value being provided in the multiples of 1024).
Document that.

Complements: d02b48c63a58 "Import of old SSLeay release: SSLeay 0.8.1b"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agoapps/enc.c: avoid signed integer overflow on bufsize assignment
Eugene Syromiatnikov [Mon, 1 Sep 2025 12:05:33 +0000 (14:05 +0200)] 
apps/enc.c: avoid signed integer overflow on bufsize assignment

The calculated option value, while being long-typed, is not checked
for fitting into int-sized bufsize.  Avoid overflow by throwing error
if it is bigger than INT_MAX and document that behaviour.

Fixes: 7e1b7485706c "Big apps cleanup (option-parsing, etc)"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665149
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agotest/bioprinttest.c: fix UB in %n result handling
Eugene Syromiatnikov [Mon, 1 Sep 2025 11:26:44 +0000 (13:26 +0200)] 
test/bioprinttest.c: fix UB in %n result handling

Per paragraph 3 of section 6.5.16.1 "Simple assignment" of ISO 9899:1999 TC3:

    If the value being stored in an object is read from another object
    that overlaps in any way the storage of the first object, then the overlap
    shall be exact and the two objects shall have qualified or unqualified
    versions of a compatible type;  otherwise, the behavior is undefined.

And that is what exactly violated when one field of the union is
assigned to another;  avoid that by introducing separate local variable
where the cast value is stored and then compared.

Fixes: 9deaf8383338 "test/bioprinttest.c: add some checks for integer and string printing"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665144
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665145
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665146
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665147
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665148
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665150
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665152
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665153
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665156
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665157
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665158
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665159
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665160
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665162
References: https://github.com/openssl/project/issues/1362
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28405)

4 weeks agoremove ossl_prov_digest_load_from_params()
Pauli [Thu, 28 Aug 2025 04:48:59 +0000 (14:48 +1000)] 
remove ossl_prov_digest_load_from_params()

This is no longer used or needed and is internal, so away it goes.

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

4 weeks agokmac: avoid using ossl_prov_digest_load_from_params()
Pauli [Thu, 28 Aug 2025 04:48:51 +0000 (14:48 +1000)] 
kmac: avoid using ossl_prov_digest_load_from_params()

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

4 weeks agopvkkdf: avoid using ossl_prov_digest_load_from_params()
Pauli [Thu, 28 Aug 2025 04:48:31 +0000 (14:48 +1000)] 
pvkkdf: avoid using ossl_prov_digest_load_from_params()

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

4 weeks agopbkdf2: avoid using ossl_prov_digest_load_from_params()
Pauli [Thu, 28 Aug 2025 04:48:10 +0000 (14:48 +1000)] 
pbkdf2: avoid using ossl_prov_digest_load_from_params()

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

4 weeks agohkdf: avoid using ossl_prov_digest_load_from_params()
Pauli [Thu, 28 Aug 2025 04:47:52 +0000 (14:47 +1000)] 
hkdf: avoid using ossl_prov_digest_load_from_params()

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

4 weeks agoFIPS: Don't allow SHA512-224 and SHA512-256 for ECDSA/DSA signatures
slontis [Fri, 29 Aug 2025 04:11:59 +0000 (14:11 +1000)] 
FIPS: Don't allow SHA512-224 and SHA512-256 for ECDSA/DSA signatures

These algorithms do not have OIDS (Note that RSA does have OIDS),
and are not valid values for FIPS.
Note that this was only possible if the "ECDSA" algorithm is fetched.
Note that "ECDSA-SHA512-256" and "ECDSA-SHA512-224" are not currently
fetchable.

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

4 weeks agoslh-dsa: enter FIPS error state if pairwise test fails
Pauli [Sun, 31 Aug 2025 07:21:42 +0000 (17:21 +1000)] 
slh-dsa: enter FIPS error state if pairwise test fails

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