]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
7 weeks agoNEWS.md: tfix: s/Medium/Moderate/ openssl-3.3
Eugene Syromiatnikov [Wed, 8 Apr 2026 10:42:01 +0000 (12:42 +0200)] 
NEWS.md: tfix: s/Medium/Moderate/

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Mon Apr 13 08:42:48 2026
(Merged from https://github.com/openssl/openssl/pull/30724)

8 weeks agoPrepare for 3.3.8
openssl-machine [Tue, 7 Apr 2026 12:40:22 +0000 (12:40 +0000)] 
Prepare for 3.3.8

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Apr  7 12:40:23 2026
Release: yes

8 weeks agoPrepare for release of 3.3.7 openssl-3.3.7
openssl-machine [Tue, 7 Apr 2026 12:40:15 +0000 (12:40 +0000)] 
Prepare for release of 3.3.7

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Apr  7 12:40:16 2026
Release: yes

8 weeks agomake update
openssl-machine [Tue, 7 Apr 2026 12:40:13 +0000 (12:40 +0000)] 
make update

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Apr  7 12:40:14 2026
Release: yes

8 weeks agoCopyright year updates
openssl-machine [Tue, 7 Apr 2026 12:38:24 +0000 (12:38 +0000)] 
Copyright year updates

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Apr  7 12:38:26 2026
Release: yes

8 weeks agoCHANGES.md, NEWS.md: update for 3.3.7
Eugene Syromiatnikov [Sun, 5 Apr 2026 10:54:45 +0000 (12:54 +0200)] 
CHANGES.md, NEWS.md: update for 3.3.7

3.3.7 CHANGES.md includes the following:
 * CVE-2026-28387, CVE-2026-28388, CVE-2026-28389, CVE-2026-28390,
   CVE-2026-31789, CVE-2026-31790
 * https://github.com/openssl/openssl/pull/30384
   "Fix #19891 CONNECT request for IPv6 targets in OSSL_HTTP_proxy_connect"
 * https://github.com/openssl/openssl/pull/30412
   "Fix detection of plaintext HTTP over TLS (3.4/3.3 backport)"

3.3.7 NEWS.md includes the following:
 * CVE-2026-28387, CVE-2026-28388, CVE-2026-28389, CVE-2026-28390,
   CVE-2026-31789, CVE-2026-31790

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Apr  7 12:08:43 2026

8 weeks agoCHANGES.md, NEWS.md: update the URL format for CVE URLs
Eugene Syromiatnikov [Mon, 6 Apr 2026 21:13:54 +0000 (23:13 +0200)] 
CHANGES.md, NEWS.md: update the URL format for CVE URLs

The URLs have been changed from [1] to [2].

[1] https://www.openssl.org/news/vulnerabilities.html
[2] https://openssl-library.org/news/vulnerabilities/

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Apr  7 12:08:41 2026

8 weeks agoCHANGES.md, NEWS.md: sort links in lexicographical order
Eugene Syromiatnikov [Mon, 6 Apr 2026 21:12:30 +0000 (23:12 +0200)] 
CHANGES.md, NEWS.md: sort links in lexicographical order

A specific order makes link addition more consistent moving forward.
The links were sorted with "LC_ALL=C sort -V" command, "sort"
is from GNU coreutils.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Apr  7 12:08:40 2026

8 weeks ago80-test_cms.t: Accept success in malformed RSA decryption
Tomas Mraz [Mon, 6 Apr 2026 20:09:20 +0000 (22:09 +0200)] 
80-test_cms.t: Accept success in malformed RSA decryption

The decryption of the malformed encrypted message might succeed
with some probability. We accept that as the testcase tries to
trigger a crash which does not happen.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Apr  7 07:16:44 2026
(cherry picked from commit 7b5ece69dee3fb78fcd2618df3bce5064a04c6dc)

8 weeks agorsa_kem: test RSA_public_encrypt() result in RSASVE
Nikola Pajkovsky [Mon, 23 Mar 2026 07:41:20 +0000 (08:41 +0100)] 
rsa_kem: test RSA_public_encrypt() result in RSASVE

RSA_public_encrypt() returns the number of bytes written on success and
-1 on failure.

Add regression coverage in evp_extra_test using invalid RSA pubkey
which triggers -1 in RSA_public_encrypt() using encapsulation.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Apr  6 19:51:31 2026
(cherry picked from commit c61bbd3f873d28e098f503f0187459ed488977c9)

8 weeks agorsa_kem: validate RSA_public_encrypt() result in RSASVE
Nikola Pajkovsky [Thu, 19 Mar 2026 11:16:08 +0000 (12:16 +0100)] 
rsa_kem: validate RSA_public_encrypt() result in RSASVE

RSA_public_encrypt() returns the number of bytes written on success and
-1 on failure. With the existing `if (ret)` check, a provider-side RSA KEM
encapsulation can incorrectly succeed when the underlying RSA public
encrypt operation fails. In that case the code reports success, returns
lengths as if encapsulation completed normally, and leaves the freshly
generated secret available instead of discarding it.

Tighten the success condition so RSASVE only succeeds when
RSA_public_encrypt() returns a positive value equal to the modulus-sized
output expected for RSA_NO_PADDING. Any other return value is treated as
failure, and the generated secret is cleansed before returning.

Fixes CVE-2026-31790
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Apr  6 19:51:30 2026
(cherry picked from commit 001e01db3e996e13ffc72386fe79d03a6683b5ac)

8 weeks agoAvoid possible buffer overflow in buf2hex conversion
Igor Ustinov [Thu, 5 Mar 2026 14:47:34 +0000 (15:47 +0100)] 
Avoid possible buffer overflow in buf2hex conversion

Fixes CVE-2026-31789

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Apr  6 19:39:23 2026
(cherry picked from commit 3244aa4b9d6ea0220cc14fd97d951c67b5052837)

8 weeks agoAdded test for CVE-2026-28388
Daniel Kubec [Tue, 17 Mar 2026 10:14:56 +0000 (11:14 +0100)] 
Added test for CVE-2026-28388

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Apr  6 19:27:17 2026
(cherry picked from commit dd3544845e206ec8cbcbd756e2d402c57fc5d313)

8 weeks agoFix NULL Dereference When Delta CRL Lacks CRL Number Extension
Daniel Kubec [Tue, 17 Mar 2026 10:11:22 +0000 (11:11 +0100)] 
Fix NULL Dereference When Delta CRL Lacks CRL Number Extension

Fixes CVE-2026-28388

Co-authored-by: Igor Morgenstern <igor.morgenstern@aisle.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Apr  6 19:27:16 2026
(cherry picked from commit d6ad8595e86dc96ca8771f0a1714b31794befa75)

8 weeks agoAdd test for CMS decryption with RSA keys
Neil Horman [Sun, 29 Mar 2026 14:47:03 +0000 (10:47 -0400)] 
Add test for CMS decryption with RSA keys

Ensure we don't encounter a segfault when decrypting CMS messages with
malformed EnvelopedData when using RSA-OAEP.

Co-authored-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Apr  6 19:09:06 2026

8 weeks agoFix NULL deref in rsa_cms_decrypt
Neil Horman [Wed, 1 Apr 2026 08:56:44 +0000 (10:56 +0200)] 
Fix NULL deref in rsa_cms_decrypt

Very simmilar to CVE-2026-28389, ensure that if we are missing
parameters in RSA-OAEP SourceFunc in CMS KeyTransportRecipientInfo,
we don't segfault when decrypting.

Co-authored-by: Tomas Mraz <tomas@openssl.foundation>
Fixes CVE-2026-28390

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Apr  6 19:09:05 2026

8 weeks agoTest for DH/ECDH CMS KARI processing NULL pointer dereference
Neil Horman [Tue, 31 Mar 2026 18:38:03 +0000 (14:38 -0400)] 
Test for DH/ECDH CMS KARI processing NULL pointer dereference

Test to ensure that, if we attempt to decrypt a CMS message with a
missing parameter field of KeyEncryptionAlgorithmIdentifier
we fail, rather than segfault.

Co-authored-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Apr  6 19:09:04 2026

8 weeks agoFix NULL deref in [ec]dh_cms_set_shared_info
Neil Horman [Mon, 16 Mar 2026 17:49:07 +0000 (13:49 -0400)] 
Fix NULL deref in [ec]dh_cms_set_shared_info

Multiple independent reports indicated a SIGSEGV was possible in CMS
processing when a crafted CMS EnvelopedData message using A Key
Agreement Recipient Info field.  If the
KeyEncryptionAlgorithmIdentifier omits the optional parameter field, the
referenced functions above will attempt to dereference the
alg->parameter data prior to checking if the parameter field is NULL.

Confirmed to resolve the issues using the reproducers provided in the
security reports.

Co-authored-by: Tomas Mraz <tomas@openssl.foundation>
Fixes CVE-2026-28389

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Apr  6 19:09:03 2026

8 weeks agodoc: document PKCS12 password prompting for certificates
kovan [Mon, 2 Feb 2026 14:47:35 +0000 (15:47 +0100)] 
doc: document PKCS12 password prompting for certificates

Document that commands reading certificates from PKCS#12 files may
prompt for a password. The existing documentation only mentioned
password prompting for private keys.

Fixes #21292

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 15:52:28 2026
(Merged from https://github.com/openssl/openssl/pull/29918)

(cherry picked from commit c7b283263290e5bbcb3aa64af5e983ae73106268)

8 weeks agoci: Fix CYGWIN build
Milan Broz [Wed, 1 Apr 2026 12:24:44 +0000 (14:24 +0200)] 
ci: Fix CYGWIN build

The build should run with -j4 option, but this option
was never propagated to run command (lost in Powershell).

Just set bash as shell here. This speedups CYGWIN CI build
significantly.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Dmitry Misharov <dmitry@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 15:45:11 2026
(Merged from https://github.com/openssl/openssl/pull/30661)

(cherry picked from commit aab7adf85a66227ff5d0261999b8aca18953b5ad)

8 weeks agocrypto/err/err_all.c: load SM2 error strings
Eugene Syromiatnikov [Mon, 30 Mar 2026 09:23:31 +0000 (11:23 +0200)] 
crypto/err/err_all.c: load SM2 error strings

The function ossl_err_load_SM2_strings() exists, but wasn't called
in ossl_err_load_crypto_strings().  Rescind this omission.

Fixes: 3d328a445c2a "Add SM2 signature and ECIES schemes"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 15:32:47 2026
(Merged from https://github.com/openssl/openssl/pull/30625)

(cherry picked from commit 6830f6281303b7c4ddb6957f4a90734a0ca82b8e)

8 weeks agoEVP_MD_CTX_gettable_params(): Add NULL check before dereference
Drokovar Dmitriy [Tue, 10 Mar 2026 05:38:57 +0000 (01:38 -0400)] 
EVP_MD_CTX_gettable_params(): Add NULL check before dereference

Found by Linux Verification Center (linuxtesting.org) with SVACE.

CLA:trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Apr  3 15:24:39 2026
(Merged from https://github.com/openssl/openssl/pull/30589)

(cherry picked from commit 9ac50d2d7bdf207c2e408bed79641169f5c69894)

8 weeks agoUpdated broken documentation links in various files
Stacey Zheng [Thu, 19 Mar 2026 22:59:38 +0000 (18:59 -0400)] 
Updated broken documentation links in various files

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Apr  3 15:18:46 2026
(Merged from https://github.com/openssl/openssl/pull/30516)

(cherry picked from commit 6f5b5acd65050d7a5a5534f27911b7b1fddcf754)

8 weeks agocrypto/x509/pcy_tree.c: fix leak of tree in X509_policy_check()
huanghuihui0904 [Mon, 16 Mar 2026 03:05:36 +0000 (11:05 +0800)] 
crypto/x509/pcy_tree.c: fix leak of tree in X509_policy_check()

When init_ret indicates both X509_PCY_TREE_EXPLICIT and X509_PCY_TREE_EMPTY,
the function returns without freeing the initialized policy tree.
Free the tree before returning, consistent with the earlier TREE_EMPTY branch.

Also defer *ptree = tree assignment and free the tree when user policies
are empty to avoid returning invalid memory.

Fixes #30435

Signed-off-by: huanghuihui0904 <625173@qq.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Apr  3 15:03:37 2026
(Merged from https://github.com/openssl/openssl/pull/30436)

(cherry picked from commit c3d24d9121ef12d8b1f2615e7655e07b5a624358)

8 weeks agoApply clang-format to the source tree
Eugene Syromiatnikov [Wed, 28 Jan 2026 15:42:00 +0000 (16:42 +0100)] 
Apply clang-format to the source tree

Ensure that all the source files are formatted with the current
.clang-format configuration, to avoid spurious clang-format checker
errors when arbitrary files are touched.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:52:06 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoAdd clang-format file exclusions for generated files related to OBJ objects.
slontis [Mon, 12 Jan 2026 05:58:34 +0000 (16:58 +1100)] 
Add clang-format file exclusions for generated files related to OBJ objects.

Original-PR: https://github.com/openssl/openssl/pull/29599
Original-Commit: a62d247888d6 "Add clang-format file exclusions for generated files related to OBJ"
Original-Merge-Date: Tue Jan 13 10:13:37 2026

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:52:03 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoMake OpenSSL generated error files use the current clang-format.
slontis [Wed, 14 Jan 2026 06:31:41 +0000 (17:31 +1100)] 
Make OpenSSL generated error files use the current clang-format.

Anytime a new error code is added it generates error related files.
These are generated using a perl script which used readable indenting.
The indenting has been removed.

Original-PR: https://github.com/openssl/openssl/pull/29631
Original-Commit: 8424f565dcbb "Make OpenSSL generated error files use the current clang-format."

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:52:02 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agofix: Have util/mkerr.pl comply better with our coding style
Richard Levitte [Tue, 16 Jul 2024 04:52:07 +0000 (06:52 +0200)] 
fix: Have util/mkerr.pl comply better with our coding style

util/mkerr.pl produced lines like these:

    {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
    "operation not supported for this keytype"},

According to our coding style, they should look like this:

    {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
     "operation not supported for this keytype"},

This nit was correctly picked up by util/check-format.pl

Original-PR: https://github.com/openssl/openssl/pull/24902
Original-Commit: 772481cf7c3f "fix: Have util/mkerr.pl comply better with our coding style"

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:52:01 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks ago.clang-format: add BLOCK_CIPHER_* macros
Eugene Syromiatnikov [Wed, 28 Jan 2026 15:16:53 +0000 (16:16 +0100)] 
.clang-format: add BLOCK_CIPHER_* macros

Cherry-picked from commits d4c1efccaba93 "Remove dead EVP_aes_*() code"
and 32eaa748a302 "Cleanup block cipher macros in include/crypto/evp.h".

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:52:00 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoAdd a couple of DH related StatementMacros, and adjust
Richard Levitte [Tue, 16 Dec 2025 09:23:16 +0000 (10:23 +0100)] 
Add a couple of DH related StatementMacros, and adjust

Original-PR: https://github.com/openssl/openssl/pull/29383
Original-Commit: 16fa01bb8612 "Add a couple of DH related StatementMacros, and adjust"

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:51:58 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoDump all known typedefs into .clang-format
Richard Levitte [Fri, 12 Dec 2025 15:11:06 +0000 (16:11 +0100)] 
Dump all known typedefs into .clang-format

This was done by calling a script I made on the spot:

    bash add-types-to-clang-format > .clang-format.new && mv .clang-format.new .clang-format

This is what that script looked like:

    #! /bin/bash

    sed -ne '1,/^CommentPragmas:/p' < .clang-format

    cat <<_____
    # OpenSSL uses typedefs extensively. Tell clang-format about them.
    TypeNames:
    _____

    include_re=$(yq -r '.repos.[].hooks.[] | select(.id == "clang-format") | .files' < .pre-commit-config.yaml)
    include_dirs=( apps crypto include providers ssl )
    git ls-files "${include_dirs[@]}" \
        | grep -E $include_re \
        | xargs ctags -f - \
        | awk -F "\t" -- '$2 ~ /\.h/ && $4 == "t" { printf "  - \"%s\"\n", $1 }' \
        | sort \
        | uniq

    cat <<_____
      # The following types are macros, and need to remain that way, unfortunately
      - "HASH_CTX"
      - "HASH_LONG"
      - "MD32_REG_T"
    _____

    sed -ne '/^# OpenSSL uses macros extensively/,$p' < .clang-format

Original-PR: https://github.com/openssl/openssl/pull/29383
Original-Commit: aa9defaa1fc4 "Dump all known typedefs into .clang-format"

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:51:57 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoAdd a few more ASN.1 related StatementMacros
Richard Levitte [Fri, 12 Dec 2025 15:36:39 +0000 (16:36 +0100)] 
Add a few more ASN.1 related StatementMacros

This resulted in an adjustment of reformatting that is a bit less trippy
in some places.

Original-PR: https://github.com/openssl/openssl/pull/29383
Original-Commit: 821b265d2194 "Add a few more ASN.1 related StatementMacros"

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:51:56 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks ago.clang-format: add "IMPLEMENT_digest_functions_with_serialize" macro
Eugene Syromiatnikov [Wed, 28 Jan 2026 15:13:48 +0000 (16:13 +0100)] 
.clang-format: add "IMPLEMENT_digest_functions_with_serialize" macro

It is cherry-picked from commit 1afb05b6035c "Add serialization for SHA-2
digest contexts" to ensure that .clang-format configuration are in sync
between branches.

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:51:54 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

8 weeks agoAdd static_ASN1_SEQUENCE_END to the list of statment macros
Bob Beck [Tue, 9 Dec 2025 16:01:16 +0000 (09:01 -0700)] 
Add static_ASN1_SEQUENCE_END to the list of statment macros

This one is pretty special, we should ponder simplifying some of
the clever preprocessor stuff here, but for now..

Original-PR: https://github.com/openssl/openssl/pull/29359
Original-Commit: ba4970afb5b6 "Add static_ASN1_SEQUENCE_END to the list of statment macros"

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 14:51:53 2026
(Merged from https://github.com/openssl/openssl/pull/29824)

2 months agoMake riscv cpucap not use BIO_snprintf
Bob Beck [Tue, 24 Mar 2026 18:24:14 +0000 (12:24 -0600)] 
Make riscv cpucap not use BIO_snprintf

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Apr  2 07:18:03 2026
(Merged from https://github.com/openssl/openssl/pull/30557)

(cherry picked from commit 636dc882a6d3f95801204b6934733ee0779f9c48)

2 months agoAdd test for NULL uri handling in OSSL_STORE_delete()
Weidong Wang [Tue, 24 Mar 2026 17:10:28 +0000 (12:10 -0500)] 
Add test for NULL uri handling in OSSL_STORE_delete()

Verify that passing NULL as the uri parameter to OSSL_STORE_delete()
returns 0 rather than crashing with a NULL pointer dereference.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Apr  2 07:14:09 2026
(Merged from https://github.com/openssl/openssl/pull/30512)

(cherry picked from commit 370954f1bbdcb9d706db990baccf6f0dcbe5dde7)

2 months agoFix NULL pointer dereference in OSSL_STORE_delete()
Weidong Wang [Fri, 20 Mar 2026 12:00:10 +0000 (07:00 -0500)] 
Fix NULL pointer dereference in OSSL_STORE_delete()

Add a NULL check for the uri parameter before passing it to
OPENSSL_strlcpy(), matching the guard already present in
OSSL_STORE_open_ex().

Fixes: 0a8807b4a838 "Store: API for deletion"
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Apr  2 07:14:08 2026
(Merged from https://github.com/openssl/openssl/pull/30512)

(cherry picked from commit c85884a4b23ff13dcafedd1835c0e5a4aff0a6ab)

2 months agoutil/platform_symbols/windows-symbols.txt: add _get_osfhandle
Eugene Syromiatnikov [Tue, 31 Mar 2026 02:46:29 +0000 (04:46 +0200)] 
util/platform_symbols/windows-symbols.txt: add _get_osfhandle

Its usage is introduced in commit b238d36c50a1 "Fix certificate read
from stdin on Windows".

Fixes: b238d36c50a1 "Fix certificate read from stdin on Windows"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Tue Mar 31 12:08:51 2026
(Merged from https://github.com/openssl/openssl/pull/30637)

(cherry picked from commit 56be1d18149d9bc908caefe1051b92a7925f224d)

2 months agoutil/platform_symbols/windows-symbols.txt: sort in lexicographical order
Eugene Syromiatnikov [Tue, 31 Mar 2026 03:19:40 +0000 (05:19 +0200)] 
util/platform_symbols/windows-symbols.txt: sort in lexicographical order

Sort using "LC_ALL=C sort -u".

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Tue Mar 31 12:08:49 2026
(Merged from https://github.com/openssl/openssl/pull/30637)

(cherry picked from commit 0bf48791457e9057ea0546573ff74e2ff9aa1152)

2 months agoDon't eat a NULL if a queryfile is not provided
Bob Beck [Fri, 27 Mar 2026 21:34:16 +0000 (15:34 -0600)] 
Don't eat a NULL if a queryfile is not provided

Fixes: 18cd23df8a8f2 "Remove "noise" comments from TS files."
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Mar 31 09:55:27 2026
(Merged from https://github.com/openssl/openssl/pull/30608)

2 months agoAdd negative length validation in EVP_EncryptUpdate and EVP_DecryptUpdate
Pranavjeet-Naidu [Tue, 24 Mar 2026 23:45:30 +0000 (05:15 +0530)] 
Add negative length validation in EVP_EncryptUpdate and EVP_DecryptUpdate

Added input length validation checks to prevent potential security issues
when negative values are passed to EVP_EncryptUpdate and EVP_DecryptUpdate.
These functions cast inl (int) to size_t without validation, which could lead
to unexpectedly large buffer allocation attempts or unintended behavior with
negative inputs.

Validation is performed early in both functions to ensure only valid,
non-negative lengths are processed. Error is reported via EVP_R_INVALID_LENGTH.

Fixes: https://github.com/openssl/openssl/issues/30486
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Mar 31 02:10:52 2026
(Merged from https://github.com/openssl/openssl/pull/30560)

(cherry picked from commit d29c165122bd480ca736a3eeb21d88a6b433ead3)

2 months agoConfigurations/10-main.conf: minimum NASM version needs to be 2.09 on Windows
Tomas Mraz [Wed, 25 Mar 2026 17:54:18 +0000 (18:54 +0100)] 
Configurations/10-main.conf: minimum NASM version needs to be 2.09 on Windows

Otherwise some assembler code might be miscompiled.

Fixes: https://github.com/openssl/openssl/issues/20529
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue Mar 31 01:47:41 2026
(Merged from https://github.com/openssl/openssl/pull/30576)

(cherry picked from commit ba21ee3795679846001e84e599bb9b286e3e6dd9)

2 months agoFix certificate read from stdin on Windows
Milan Broz [Tue, 24 Mar 2026 13:50:21 +0000 (14:50 +0100)] 
Fix certificate read from stdin on Windows

On Windows, reading certificate from stdin could fail like

    > type cert.der| openssl.exe x509 -inform DER -outform PEM
    Could not find or decode certificate from <stdin>

The decoder already tries to insert BIO_f_readbuffer
in this case, unfortunately it depends on undefined behavior
of ftell() on Windows.

Fix it by adding check for non-seekable input case
to BIO file control.

Note, the added testcase tests binary input certificate,
but does not trigger this issue explicitly.

Fixes: https://github.com/openssl/openssl/issues/19508
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Mar 31 01:38:21 2026
(Merged from https://github.com/openssl/openssl/pull/30559)

(cherry picked from commit b238d36c50a177eb8d5fb384e51fe03c9e81001a)

2 months agodoc: fix -signcert grouping in CA.pl documentation
kovan [Tue, 27 Jan 2026 11:11:08 +0000 (12:11 +0100)] 
doc: fix -signcert grouping in CA.pl documentation

The -signcert option was incorrectly grouped with -sign and -xsign at
line 109, which implied they were equivalent. However, -signcert is
different: it expects a self-signed certificate (not a certificate
request) in newreq.pem, and converts it to a request before signing.

This is correctly documented in its own separate section at line 123,
which states "-signcert is the same as -sign except it expects a self
signed certificate".

Remove -signcert from the -sign/-xsign grouping to eliminate the
contradiction.

Resolves: https://github.com/openssl/openssl/issues/29165
Fixes: 022696cab014 "Allow CA.pl script user to pass extra arguments to openssl command"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Mar 31 01:10:50 2026
(Merged from https://github.com/openssl/openssl/pull/29794)

(cherry picked from commit 44e453d0f9c765e14c4d1f5dcde9a616fc7d05df)

2 months agoFixed missing subjectAltName when issuing a cert with mkcert.sh genee
K1 [Thu, 26 Mar 2026 12:14:37 +0000 (20:14 +0800)] 
Fixed missing subjectAltName when issuing a cert with mkcert.sh genee

Just add %s to make subjectAltName appear before [alts].

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:53:28 2026
(Merged from https://github.com/openssl/openssl/pull/30585)

(cherry picked from commit b8df87aca7efa75b3386c237f7a977ef5c6571fc)

2 months agoquic: add missing return 0 after raise_protocol_error for NEW_CONN_ID
Abhinav Agarwal [Tue, 24 Mar 2026 02:17:04 +0000 (19:17 -0700)] 
quic: add missing return 0 after raise_protocol_error for NEW_CONN_ID

Every other frame type handler in depack_process_frames() returns 0
after calling ossl_quic_channel_raise_protocol_error(), but the
NEW_CONN_ID case falls through to depack_do_frame_new_conn_id().

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 27 16:48:44 2026
(Merged from https://github.com/openssl/openssl/pull/30550)

(cherry picked from commit e6e01f00aa4196d3c133fac6c83dccfbda5b1e69)

2 months agoAdd NULL checks for the arguments in OSSL_PARAM_BLD_push_*() functions
Igor Ustinov [Mon, 23 Mar 2026 13:35:30 +0000 (14:35 +0100)] 
Add NULL checks for the arguments in OSSL_PARAM_BLD_push_*() functions

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Fri Mar 27 16:46:48 2026
(Merged from https://github.com/openssl/openssl/pull/30542)

(cherry picked from commit d5ad0b89b15522ceec93db5c97ac3fed2ccbeaa6)

2 months agoCMS_verify(): Fix leak of tmpin in an error path
openssl-machine [Mon, 23 Mar 2026 08:09:03 +0000 (09:09 +0100)] 
CMS_verify(): Fix leak of tmpin in an error path

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:43:44 2026
(Merged from https://github.com/openssl/openssl/pull/30535)

(cherry picked from commit 2036e997430f4bee75d3a60301f7ecc8c2e66198)

2 months agoDoc: clarify AAD out1 semantics in EVP_EncryptInit
William Faber [Sun, 22 Mar 2026 21:29:27 +0000 (17:29 -0400)] 
Doc: clarify AAD out1 semantics in EVP_EncryptInit

Fixes #29761

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:40:23 2026
(Merged from https://github.com/openssl/openssl/pull/30533)

(cherry picked from commit 0d8454ed32ff7ed5b9b5f5a9e32eb7fa1a753cea)

2 months agos390x: set minimum architecture level to z10
Amaan Qureshi [Fri, 20 Mar 2026 00:40:20 +0000 (20:40 -0400)] 
s390x: set minimum architecture level to z10

The keccak1600 perlasm file (`keccak1600-s390x.pl`) emits `cijne`, a
z10 compare-immediate-and-branch instruction, without declaring a
minimum architecture level. GCC defaults to `-march=z900` on s390x,
causing assembler errors when building with the default toolchain
flags:

    keccak1600-s390x.S:399: Error: Unrecognized opcode: `cijne'

z900 has been out of service since 2014, the Linux kernel requires
z196 minimum, and clang already defaults to z10 on s390x. A
`.machine "z10"` GAS directive in the generated assembly resolves the
error by declaring the architecture level the file already requires.

Ref: #27323

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:32:22 2026
(Merged from https://github.com/openssl/openssl/pull/30507)

(cherry picked from commit 189cf6f0b873e21902e1b1fc6f85fd89d003b847)

2 months agodoc: Clarify wording in PKCS5_PBE_keyivgen.pod
Zoey Chapell [Sun, 15 Feb 2026 00:39:20 +0000 (19:39 -0500)] 
doc: Clarify wording in PKCS5_PBE_keyivgen.pod

Resolves #12519 by adding to the DESCRIPTION section. Documentation only change.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:17:02 2026
(Merged from https://github.com/openssl/openssl/pull/29984)

(cherry picked from commit b31d15ba6a555e326cd5d1b7cf964ca6218b996f)

2 months agoFix missing EVP_CIPHER_get_iv_length() guard in PKCS5_pbe2_set_scrypt
Weidong Wang [Sat, 21 Mar 2026 15:41:49 +0000 (10:41 -0500)] 
Fix missing EVP_CIPHER_get_iv_length() guard in PKCS5_pbe2_set_scrypt

Store the return value of EVP_CIPHER_get_iv_length() in a local variable
and guard with (ivlen > 0) before passing to memcpy/RAND_bytes, matching
the pattern already used in p5_pbev2.c. Without this, a negative return
value (-1) is implicitly converted to SIZE_MAX when cast to size_t,
causing a stack buffer overflow on iv[EVP_MAX_IV_LENGTH].

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 27 16:14:09 2026
(Merged from https://github.com/openssl/openssl/pull/30510)

(cherry picked from commit 3e903838e341e9fc884c4d87e4a295d4a722414b)

2 months agocrypto/idea/i_ofb64.c: mask the num value after negativity check
Eugene Syromiatnikov [Sun, 22 Mar 2026 01:16:27 +0000 (02:16 +0100)] 
crypto/idea/i_ofb64.c: mask the num value after negativity check

Commit 5ba9029bc7b3 "Mask *num on entry in deprecated low-level OFB/CFB
implementations" introduced masking of the user-supplied num value
in several functions, which rendered the exiting *num negativity check
introduced in 1634b2df9f12 "enc: fix coverity 145149914515011451506,
14515071351511145151414515171451523, 1451526m 14515281451539,
145144114515491451568 & 1451572: improper use of negative value"
ineffectual.  While commit b73a5743253d "crypto/idea/i_cfb64.c:
condition 'n < 0' can never be met after doing 'n = n & 0x07'"
has addressed the issue in crypto/idea/i_cfb64.c:IDEA_cfb64_encrypt(),
this commit addresses the same issue
in crypto/idea/i_ofb64.c:IDEA_ofb64_encrypt() in similar fashion,
by postponing the masking after the negativity check.

The issue has initially reported by Coverity, ID 1689815.

Resolves: https://scan5.scan.coverity.com/#/project-view/62622/10222?selectedIssue=1689815
Fixes: 5ba9029bc7b3 "Mask *num on entry in deprecated low-level OFB/CFB implementations"
References: b73a5743253d "crypto/idea/i_cfb64.c: condition 'n < 0' can never be met after doing 'n = n & 0x07'"
Co-Authored-by: Alexandr Nedvedicky <sashan@openssl.org>
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Mar 24 17:52:35 2026
(Merged from https://github.com/openssl/openssl/pull/30528)

(cherry picked from commit fae68066ec117bd0d38166687e9bc62fd43bd42f)

2 months agotest: add regression tests for unauthorized OCSP response signers
1seal [Tue, 17 Mar 2026 09:14:32 +0000 (10:14 +0100)] 
test: add regression tests for unauthorized OCSP response signers

This is a backport of commit 355ea2ba25f4 "test: add regression tests
for unauthorized OCSP response signers" that includes only parts
pertaining the openssl ocsp command testing.  The original commit
message:

    extend test_tlsext_status_type() with a handshake that serves a
    leaf-signed stapled OCSP response and verifies the connection fails
    when X509_V_FLAG_OCSP_RESP_CHECK is enabled.

    generalize ocsp_server_cb_single() to use configurable signer
    cert/key instead of hardcoded paths so the same callback serves
    both authorized and unauthorized signer test cases.

    add a test_ocsp() subtest covering the -issuer CLI option with
    an untrusted issuer hint.

Link: https://github.com/openssl/openssl/pull/30323
References: 355ea2ba25f4 "test: add regression tests for unauthorized OCSP response signers"

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:50:49 2026
(Merged from https://github.com/openssl/openssl/pull/30527)

(cherry picked from commit 5ee22b011b13f2fe635e6225dc2f9a90ce0ffc4f)

2 months agox509: remove OCSP_TRUSTOTHER from stapled response and issuer fallback paths
1seal [Tue, 17 Mar 2026 09:14:21 +0000 (10:14 +0100)] 
x509: remove OCSP_TRUSTOTHER from stapled response and issuer fallback paths

This is backport of 8a630915c045 "x509: remove OCSP_TRUSTOTHER from stapled
response and issuer fallback paths" that includes only parts pertaining
the openssl ocsp command.  Original commit message:

    check_cert_ocsp_resp() verified stapled OCSP responses with
    OCSP_TRUSTOTHER while passing the peer-provided chain (ctx->chain),
    which allowed certificates from that chain to be treated as trusted
    OCSP responder signers.

    similarly, the ocsp CLI issuer fallback path unconditionally used
    OCSP_TRUSTOTHER, making certificates given via -issuer implicitly
    trusted regardless of verify_flags.

    remove OCSP_TRUSTOTHER from both paths so that responder authorization
    is validated against the trust store.

Link: https://github.com/openssl/openssl/pull/30323
References: 8a630915c045 "x509: remove OCSP_TRUSTOTHER from stapled response and issuer fallback paths"
Fixes: c6724060e267f "RT2206: Add -issuer flag to ocsp command"
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:50:48 2026
(Merged from https://github.com/openssl/openssl/pull/30527)

(cherry picked from commit a046f95e1d09d65b65d9ab14fb086707fe6b9bad)

2 months agoconf: guard NULL group in NCONF_get_string() error path
easonysliu [Wed, 18 Mar 2026 08:22:24 +0000 (16:22 +0800)] 
conf: guard NULL group in NCONF_get_string() error path

NCONF_get_string() passes the group parameter directly to
ERR_raise_data() with a %s format specifier.  The CONF API
explicitly allows group to be NULL (meaning "default section"),
and multiple internal callers use this, such as conf_diagnostics()
and CONF_modules_load().

When the lookup fails and the error path is reached, passing NULL
to %s is undefined behavior per the C standard.  On Linux/glibc
it happens to print "(null)", but on platforms like Solaris 10 it
crashes in strlen() inside vsnprintf().

This was exposed after commit #28305 replaced the custom _dopr()
(which had an explicit NULL-to-"<NULL>" guard in fmtstr()) with
the platform's native vsnprintf().

Guard the NULL by using an empty string in the format argument.

Fixes #30402

CLA: trivial

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:39:02 2026
(Merged from https://github.com/openssl/openssl/pull/30484)

(cherry picked from commit cd20f1af1cfe3ca0b733201654667582788eb014)

2 months agoapps/cmp.c: fix leak of out_trusted in setup_verification_ctx()
huanghuihui0904 [Thu, 12 Mar 2026 13:01:30 +0000 (21:01 +0800)] 
apps/cmp.c: fix leak of out_trusted in setup_verification_ctx()

setup_verification_ctx() allocates out_trusted via load_trusted() and passes
it to OSSL_CMP_CTX_set_certConf_cb_arg(). Since the argument is not consumed,
it must be freed on failure. The fix is to free out_trusted if
OSSL_CMP_CTX_set_certConf_cb_arg() fails.

Fixes #30377

Signed-off-by: huanghuihui0904 <625173@qq.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:34:49 2026
(Merged from https://github.com/openssl/openssl/pull/30392)

(cherry picked from commit 6f01df42cd0fff76dc789e50f5f86addd6103192)

2 months agoFix CONNECT request for IPv6 targets in OSSL_HTTP_proxy_connect
Peter Zhang [Wed, 11 Mar 2026 22:59:48 +0000 (22:59 +0000)] 
Fix CONNECT request for IPv6 targets in OSSL_HTTP_proxy_connect

When server contains a bare IPv6 address, OSSL_HTTP_proxy_connect() must
wrap it in square brackets for the CONNECT request line (e.g.,
CONNECT [::1]:443 HTTP/1.0).  Also handle the case where the server
string already includes brackets (as returned by OSSL_HTTP_parse_url).

Fixes: 29f178bddfdb ("Generalize the HTTP client so far implemented mostly in crypto/ocsp/ocsp_ht.c")
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:32:06 2026
(Merged from https://github.com/openssl/openssl/pull/30384)

(cherry picked from commit b721a59fef180311d62a932c2d5be8a83942cbbe)

2 months agoAdd more details to the certification path building documentation
Marcel Merkle [Mon, 9 Mar 2026 09:01:28 +0000 (10:01 +0100)] 
Add more details to the certification path building documentation

Added more details about the certification path building algorithm,
especially about the behavior in case of incomplete chains in the trust
store.

Fixes #29681

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:24:15 2026
(Merged from https://github.com/openssl/openssl/pull/30317)

(cherry picked from commit 6a5fea7ec5df1c8cc4bb5006013301b41d0accd4)

2 months agoInitialize thread id on NonStop where pthread_id is not a primitive type.
Randall S. Becker [Sun, 1 Feb 2026 18:18:22 +0000 (18:18 +0000)] 
Initialize thread id on NonStop where pthread_id is not a primitive type.

Fixes: #29854
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 17:09:30 2026
(Merged from https://github.com/openssl/openssl/pull/29882)

(cherry picked from commit e33c45ed4530a50e246d5fcf8c8e31fd9cf5ce20)

2 months agoUnalias DSA sig dupctx "aid" field
Viktor Dukhovni [Mon, 23 Mar 2026 02:51:34 +0000 (13:51 +1100)] 
Unalias DSA sig dupctx "aid" field

It points into a static buffer in each context, use the same offset into
the copied buffer when duplicating.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 24 15:40:56 2026
(Merged from https://github.com/openssl/openssl/pull/30534)

2 months agocrypto/idea/i_cfb64.c: condition 'n < 0' can never be met after doing 'n = n & 0x07'
Alexandr Nedvedicky [Thu, 19 Mar 2026 07:21:24 +0000 (08:21 +0100)] 
crypto/idea/i_cfb64.c: condition 'n < 0' can never be met after doing 'n = n & 0x07'

Resolves: https://scan5.scan.coverity.com/#/project-view/62622/10222?selectedIssue=1689816
Fixes: 5ba9029bc7b3 "Mask *num on entry in deprecated low-level OFB/CFB implementations"
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sun Mar 22 00:06:11 2026
(Merged from https://github.com/openssl/openssl/pull/30500)

2 months agossl/statem/statem_dtls.c: fix leak in dtls1_buffer_message()
huanghuihui0904 [Mon, 16 Mar 2026 07:16:21 +0000 (15:16 +0800)] 
ssl/statem/statem_dtls.c: fix leak in dtls1_buffer_message()

pqueue_insert() may fail, but its return value was not checked. This could leak the allocated pitem and handshake fragment. Free them when insertion fails, using pitem_free() for proper cleanup.

Solves https://github.com/openssl/openssl/issues/30442

Fixes #30442

Signed-off-by: huanghuihui0904 <625173@qq.com>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sat Mar 21 23:30:44 2026
(Merged from https://github.com/openssl/openssl/pull/30443)

2 months agoFix ECDSA sig CTX dup error paths
Viktor Dukhovni [Wed, 18 Mar 2026 00:44:30 +0000 (11:44 +1100)] 
Fix ECDSA sig CTX dup error paths

- Rare error paths could lead to a memory leak or to use-after-free
  and/or double-free.

Reported by Kenaz Wang.

Fixes: edd3b7a309f8 "Add ECDSA to providers"
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 20 18:36:14 2026
(Merged from https://github.com/openssl/openssl/pull/30478)

2 months agoquic: fix NULL pointer dereference in ossl_uint_set_remove()
Abhinav Agarwal [Wed, 18 Mar 2026 16:01:07 +0000 (09:01 -0700)] 
quic: fix NULL pointer dereference in ossl_uint_set_remove()

In the range-splitting path, create_set_item() can return NULL under
memory pressure. The result was passed directly to
ossl_list_uint_set_insert_after() without a NULL check, causing an
immediate crash. This path is reachable during normal QUIC ACK
processing under memory exhaustion.

Check the allocation result before insertion and return 0 on failure.

Fixes: c5ca718003e6 "uint_set: convert uint_set to use the list data type"
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 19 20:12:37 2026
(Merged from https://github.com/openssl/openssl/pull/30490)

2 months agoRemoves unused config_inited value in init.c
Frederik Wedel-Heinen [Sat, 14 Mar 2026 05:43:34 +0000 (06:43 +0100)] 
Removes unused config_inited value in init.c

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 19 10:45:48 2026
(Merged from https://github.com/openssl/openssl/pull/30420)

2 months agoUpdate ssl/quic/quic_srtm.c
Sashan [Mon, 16 Mar 2026 07:43:45 +0000 (08:43 +0100)] 
Update ssl/quic/quic_srtm.c

Co-authored-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Mar 18 17:26:47 2026
(Merged from https://github.com/openssl/openssl/pull/30371)

(cherry picked from commit 84e522ddb6b68a402fc6e1704dd089a26c8ca9cf)

2 months agoQUIC stack must disable hash table contraction before doing
Alexandr Nedvedicky [Wed, 11 Mar 2026 13:12:29 +0000 (14:12 +0100)] 
QUIC stack must disable hash table contraction before doing
lh_TYPE_doall(lh, lh_TYPE_delete). Not doing so may dereference
dead memory when traversing to next item in hash table.

One has to call lh_TYPE_set_down_load(lh, 0) to disable hash
table contraction when table is being destroyed during the
_doall() traversal.

call lh_TYPE_set_down_load(lh, 0) before doing
lh_TYPE_daall() with lh_TYPE_delete(). This disables

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Mar 18 17:26:44 2026
(Merged from https://github.com/openssl/openssl/pull/30371)

(cherry picked from commit f65bcab102872dba0c7e9f5d08a3fdcedfeed200)

2 months agoMask *num on entry in deprecated low-level OFB/CFB implementations
frostb1ten [Mon, 16 Mar 2026 10:07:12 +0000 (05:07 -0500)] 
Mask *num on entry in deprecated low-level OFB/CFB implementations

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Wed Mar 18 07:15:11 2026
(Merged from https://github.com/openssl/openssl/pull/30447)

2 months agoFix incorrect error return in ppc_aes_gcm_cipher_update decrypt path
Scott [Mon, 16 Mar 2026 17:30:50 +0000 (12:30 -0500)] 
Fix incorrect error return in ppc_aes_gcm_cipher_update decrypt path

ppc_aes_gcm_cipher_update() returns 1 on success and 0 on failure.
The decrypt pre-alignment path (line 122) incorrectly returned -1
instead of 0 when CRYPTO_gcm128_decrypt() failed.

Since the caller checks `if (!hw->cipherupdate(...))`, and !(-1)
evaluates to 0 (false) in C, the error was silently swallowed and
GCM processing continued with potentially corrupt state.

The encrypt path at line 98 correctly returns 0. This was likely a
copy-paste error when the decrypt path was added.

Fixes #30380

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Mar 18 07:04:47 2026
(Merged from https://github.com/openssl/openssl/pull/30452)

2 months agopkcs7: fix NULL contents dereference in PKCS7_stream
Weidong Wang [Tue, 10 Mar 2026 17:42:35 +0000 (12:42 -0500)] 
pkcs7: fix NULL contents dereference in PKCS7_stream

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Tue Mar 17 17:01:56 2026
(Merged from https://github.com/openssl/openssl/pull/30351)

(cherry picked from commit 4b8968753c7509da4c51ea3343e3c089433bad5b)

2 months agopkcs7: fix NULL contents dereference in PKCS7_dataFinal
Weidong Wang [Tue, 10 Mar 2026 17:15:22 +0000 (12:15 -0500)] 
pkcs7: fix NULL contents dereference in PKCS7_dataFinal

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Tue Mar 17 17:01:53 2026
(Merged from https://github.com/openssl/openssl/pull/30351)

(cherry picked from commit 70837aa2385bc83226375d74f02fe5c03a3e0d21)

2 months agopkcs7: fix NULL contents dereference in PKCS7_ctrl
Weidong Wang [Tue, 10 Mar 2026 17:08:35 +0000 (12:08 -0500)] 
pkcs7: fix NULL contents dereference in PKCS7_ctrl

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Tue Mar 17 17:01:49 2026
(Merged from https://github.com/openssl/openssl/pull/30351)

(cherry picked from commit b43e441550b2d1f1a99e42807f08329666934e63)

2 months agoFix integer truncation in ppc_aes_gcm_crypt
Scott [Mon, 16 Mar 2026 03:53:04 +0000 (22:53 -0500)] 
Fix integer truncation in ppc_aes_gcm_crypt

The assembly functions ppc_aes_gcm_encrypt and ppc_aes_gcm_decrypt
return size_t, but their return values were stored in int variables,
causing truncation on PPC64 where size_t is 64-bit. This could lead
to incorrect results when processing inputs larger than 2GB via
EVP_Cipher() which accepts unsigned int lengths.

Change the types of s and ndone from int to size_t to match the
function return type and the return type of ppc_aes_gcm_crypt itself.

Tested on POWER8 S824 (ppc64le) — all EVP and cipher tests pass,
AES-128-GCM benchmarks at 2.94 GB/s with hardware acceleration.

CLA: trivial

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Tue Mar 17 09:44:33 2026
(Merged from https://github.com/openssl/openssl/pull/30437)

(cherry picked from commit e443447588640d099a3e2f1001cf67dab921f935)

2 months agoAdd a test to confirm that we get the expected error with HTTP
Matt Caswell [Fri, 27 Feb 2026 12:25:04 +0000 (12:25 +0000)] 
Add a test to confirm that we get the expected error with HTTP

If we send HTTP directly over a TLS connection then we expect to receive
the SSL_R_HTTP_REQUEST error. So we add a test to confirm that we do.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Mar 16 12:54:59 2026
(Merged from https://github.com/openssl/openssl/pull/30412)

2 months agoDefer the check that the record fits in our buffer
Matt Caswell [Fri, 27 Feb 2026 11:57:41 +0000 (11:57 +0000)] 
Defer the check that the record fits in our buffer

Previously we confirmed that the record we received from the peer
actually fits in our buffer before validating the record header. However,
this interferes with the checks that the "any" method does for accidental
use of HTTP because the record length will be wrong in this case. To solve
this we simply defer the check until after the record header has been
validated.

Fixes #30196

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Mar 16 12:54:58 2026
(Merged from https://github.com/openssl/openssl/pull/30412)

2 months agoBIO: Fix typo in BIO_pop documentation
Paz David [Thu, 12 Mar 2026 22:26:40 +0000 (00:26 +0200)] 
BIO: Fix typo in BIO_pop documentation

Corrected "is is" to "it is" in the BIO_pop() description to
improve documentation clarity.

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Mon Mar 16 11:30:42 2026
(Merged from https://github.com/openssl/openssl/pull/30404)

(cherry picked from commit e1eb88118a95445eb9c2d074c853776feaab4de7)

2 months agodocs: Fix SSL_CERT_DIR env var
Norbert Pocs [Wed, 4 Mar 2026 15:48:12 +0000 (16:48 +0100)] 
docs: Fix SSL_CERT_DIR env var

Complements: dfdbc113eefb "Partially revert #18070 (Add support for Windows CA certificate store)"

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Mon Mar 16 11:24:06 2026
(Merged from https://github.com/openssl/openssl/pull/30390)

(cherry picked from commit 00dcd4527d477544b0ff5727a377bc37f96f946f)

2 months agoapps/cmp_mock_srv: fix resource leak in process_genm()
YZL0v3ZZ [Wed, 11 Mar 2026 14:31:47 +0000 (22:31 +0800)] 
apps/cmp_mock_srv: fix resource leak in process_genm()

If pushing the generated rsp ITAV object into the out stack fails,
the error path frees the stack container but permanently abandons
the newly allocated rsp object.

Explicitly free the rsp structure if it exists and was not pushed
successfully to prevent this memory leak.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon Mar 16 11:16:02 2026
(Merged from https://github.com/openssl/openssl/pull/30374)

(cherry picked from commit b4a964f6c1313d386c45a747820d82a1a5ec4573)

2 months agoriscv: aes: fix checks on null keys
Zenithal [Tue, 10 Mar 2026 00:44:01 +0000 (00:44 +0000)] 
riscv: aes: fix checks on null keys

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Fri Mar 13 17:15:37 2026
(Merged from https://github.com/openssl/openssl/pull/30333)

(cherry picked from commit fdee5cf246c73be74e6f9fbbe28e387a224c0041)

2 months agoossl_bsearch: Fix possible integer overflow bug
Joseph Paul [Tue, 10 Mar 2026 13:00:49 +0000 (18:30 +0530)] 
ossl_bsearch: Fix possible integer overflow bug

Adding the high and low limits might cause the classic binary
search overflow bug. Probably not a concern but its one less
thing to worry about.

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 13 08:37:00 2026
(Merged from https://github.com/openssl/openssl/pull/30342)

2 months agodoc: Fix X509_NAME_print documentation to reflect actual behavior
kovan [Mon, 2 Feb 2026 11:35:29 +0000 (12:35 +0100)] 
doc: Fix X509_NAME_print documentation to reflect actual behavior

The documentation claimed that X509_NAME_print() would indent each line
by obase characters and wrap lines exceeding 80 characters. However, the
implementation has never actually used obase for any purpose since the
line-wrapping code was removed in 2007 as unreachable.

Update the documentation to state that obase is ignored and the function
outputs on a single line.

Fixes #18004

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 13 08:22:52 2026
(Merged from https://github.com/openssl/openssl/pull/29900)

2 months agoapps: unload provider on app_provider_load() failure
Brittany Morris [Mon, 9 Mar 2026 01:38:53 +0000 (21:38 -0400)] 
apps: unload provider on app_provider_load() failure

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Fri Mar 13 08:11:38 2026
(Merged from https://github.com/openssl/openssl/pull/30314)

2 months agoRemove static int from .bss
Joshua Rogers [Wed, 29 Oct 2025 19:12:33 +0000 (03:12 +0800)] 
Remove static int from .bss

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 18:22:02 2026
(Merged from https://github.com/openssl/openssl/pull/28909)

(cherry picked from commit 3b8e522ae2767f3e2cf579499864d19749e03ea0)

2 months agoNonStop: reset hpns_connect_attempt at call start and on success
Joshua Rogers [Sun, 12 Oct 2025 14:08:04 +0000 (22:08 +0800)] 
NonStop: reset hpns_connect_attempt at call start and on success

Ensure the NonStop fallback state does not leak across calls by clearing hpns_connect_attempt at the beginning of RAND_query_egd_bytes and after a successful connect. No impact on other platforms.

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 18:22:00 2026
(Merged from https://github.com/openssl/openssl/pull/28909)

(cherry picked from commit 435b6510a35ae71e4d39506dc06e8fba91435ce2)

2 months agorand_egd: harden EGD I/O and bounds; defer fdopen until post connect
Joshua Rogers [Sun, 12 Oct 2025 13:52:21 +0000 (21:52 +0800)] 
rand_egd: harden EGD I/O and bounds; defer fdopen until post connect

Tighten RAND_query_egd_bytes and fix edge cases:

* Reject nonpositive request sizes to avoid wrap when storing the
  length byte in tempbuf[1].
* Treat server length byte as untrusted; bound by the requested size
  and by sizeof(tempbuf) to avoid overrunning caller or stack buffers.
* Defer fdopen until after a successful connect. On HPE NonStop
  (OPENSSL_SYS_TANDEM) the connect retry path may swap the socket fd;
  creating the FILE* early could leave a stale stream pointing at a
  closed descriptor, causing EBADF or short I/O, and leaking the new
  socket. Creating the stream after connect avoids this.
* Initialize fd to -1 and close the raw fd when fdopen fails; ensure
  we close either FILE* or the raw fd on all error paths.
* Remove unused code.

Behavior is unchanged on platforms that do not swap fds during connect.
On TANDEM it prevents stale I/O and descriptor leaks. Overall this
improves robustness and bounds checking for EGD interactions.

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 17:58:21 2026
(Merged from https://github.com/openssl/openssl/pull/28905)

(cherry picked from commit e6aabdfb452de672f5c25ffc490ba35b82c6db76)

2 months agoFix a one byte buffer overflow in s_client
Matt Caswell [Wed, 11 Mar 2026 15:06:32 +0000 (15:06 +0000)] 
Fix a one byte buffer overflow in s_client

The buffer used to process user commands when using advanced mode ("-adv")
can overflow the buffer by one byte if the the read buffer is exactly
BUFSIZZ bytes in length (16k). When processing the buffer we add a NUL
terminator to the buffer, so if the buffer is already full then we
overwrite by one byte when we add the NUL terminator.

This does not represent a security issue because this is entirely local
and would be "self-inflicted", i.e. not under attacker control.

This issue was reported to use by Igor Morgenstern from AISLE.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Thu Mar 12 17:56:37 2026
(Merged from https://github.com/openssl/openssl/pull/30376)

(cherry picked from commit 440ac348bf7ad86aaed3eb6a18c7ce587dccb350)

2 months agoFix error handling in SSL_CTX_add_session
Bernd Edlinger [Mon, 22 Sep 2025 14:23:47 +0000 (16:23 +0200)] 
Fix error handling in SSL_CTX_add_session

An out-of-memory error in lh_SSL_SESSION_insert
could trigger various use-after-free errors.

Fixes #28632

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 17:51:38 2026
(Merged from https://github.com/openssl/openssl/pull/28636)

(cherry picked from commit 0a72e6ae74a6d32977ac53cbf314f414c08b327b)

2 months agodoc/man3/OPENSSL_malloc: clarify OPENSSL_clear_free() w/ NULL
dann frazier [Wed, 30 Jul 2025 14:51:30 +0000 (08:51 -0600)] 
doc/man3/OPENSSL_malloc: clarify OPENSSL_clear_free() w/ NULL

It wasn't explicitly clear that it was safe to call OPENSSL_clear_free()
with a NULL because, as worded, it sounded like it may call
OPENSSL_cleanse() on NULL before calling OPENSSL_free().

CLA: trivial

Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 17:43:51 2026
(Merged from https://github.com/openssl/openssl/pull/28127)

(cherry picked from commit 4adb40393c073fd5ac34495efd083e981a6a6d69)

2 months agoFix stack buffer over-read in DES OFB/CFB64 via unchecked num parameter
OwenSanzas [Tue, 10 Mar 2026 00:05:35 +0000 (00:05 +0000)] 
Fix stack buffer over-read in DES OFB/CFB64 via unchecked num parameter

The `num` parameter in DES OFB64/CFB64 functions tracks the byte offset
within an 8-byte DES block, so valid values are 0-7. However, neither
the EVP set_params path nor the low-level DES functions validated this
bound, allowing an out-of-range `num` to cause a stack buffer over-read
when used as an array index into the 8-byte keystream buffer.

Fix at two levels:
1. Provider layer: reject num >= blocksize in
   ossl_cipher_common_set_ctx_params() before it reaches the cipher.
2. Low-level DES: mask `*num` with `& 0x07` on entry to
   DES_ofb64_encrypt, DES_ede3_ofb64_encrypt, DES_cfb64_encrypt,
   and DES_ede3_cfb64_encrypt, consistent with how `n` is already
   masked at the end of these functions before being written back.

Fixes #30284

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Thu Mar 12 14:24:12 2026
(Merged from https://github.com/openssl/openssl/pull/30332)

(cherry picked from commit 134342e194a23b1d3cc0687b05d97cfdd0f31c4a)

2 months agofix NULL pointer dereference when pass1 is NULL
Alexandr Nedvedicky [Wed, 11 Mar 2026 07:30:01 +0000 (08:30 +0100)] 
fix NULL pointer dereference when pass1 is NULL

Resolves: https://scan5.scan.coverity.com/#/project-view/62622/10222?selectedIssue=1684201
Complements: #adc8e4abd96 Fix Memory leak in app_passwd

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 12 11:33:37 2026
(Merged from https://github.com/openssl/openssl/pull/30365)

2 months agoadd an initial space to format a command in `openssl-cms.pod.in`
Pablo Rodríguez [Thu, 5 Mar 2026 16:49:12 +0000 (17:49 +0100)] 
add an initial space to format a command in `openssl-cms.pod.in`
CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 12 08:43:44 2026
(Merged from https://github.com/openssl/openssl/pull/30274)

2 months agoFix OSSL_parse_url userinfo scan past authority
1seal [Mon, 9 Mar 2026 10:48:49 +0000 (11:48 +0100)] 
Fix OSSL_parse_url userinfo scan past authority

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed Mar 11 10:22:54 2026
(Merged from https://github.com/openssl/openssl/pull/30319)

(cherry picked from commit 7aedbb34d01cc3dca6218bad454d795c09ba89e7)

2 months agosafe_math: documentation example fix
Pauli [Wed, 4 Mar 2026 23:28:15 +0000 (10:28 +1100)] 
safe_math: documentation example fix

The example was for an older version of the code which used triadic
macros to define the functions.  The code was simplified making these
dyadic but the example was skipped.  This fixes the example.

Fixes: cccfc668286c "doc: document the internal integer overflow helpers"
References: b037e3637a49 "header: add integer overflow helper functions"

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Mar 11 10:19:05 2026
(Merged from https://github.com/openssl/openssl/pull/30266)

(cherry picked from commit 77f1718f6f81aa269f8b46a7ba6d186c3477215a)

2 months agoFix memory leak in `EC_GROUP_copy()`
Weidong Wang [Mon, 9 Mar 2026 10:19:11 +0000 (05:19 -0500)] 
Fix memory leak in `EC_GROUP_copy()`

We must free pre_comp before its overwrite.

Fixes: 3aef36ffef89 "Add CRYPTO_EX_DATA; remove EC_EXTRA_DATA"
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Tue Mar 10 19:04:33 2026
(Merged from https://github.com/openssl/openssl/pull/30320)

(cherry picked from commit 99ba983e28f07c6dc38538cd9bc71cd3e070f3c4)

2 months agoFix Memory leak in app_passwd
huanghuihui0904 [Mon, 9 Mar 2026 14:57:00 +0000 (22:57 +0800)] 
Fix Memory leak in app_passwd

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue Mar 10 17:42:48 2026
(Merged from https://github.com/openssl/openssl/pull/30325)

(cherry picked from commit adc8e4abd962b448354756fef24be499278875ae)

2 months agoFix memory leak of p and q in ossl_rsa_fromdata error path
Uni [Fri, 6 Mar 2026 20:24:28 +0000 (21:24 +0100)] 
Fix memory leak of p and q in ossl_rsa_fromdata error path

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Mar 10 15:52:35 2026
(Merged from https://github.com/openssl/openssl/pull/30298)

(cherry picked from commit 0d5a73eb380acf9ad6e3c45c06c728b94cc44438)

2 months agodane_match_cert() should X509_free() on ->mcert instead
Alexandr Nedvedicky [Tue, 3 Mar 2026 12:23:46 +0000 (13:23 +0100)] 
dane_match_cert() should X509_free() on ->mcert instead
of OPENSSL_free()

Fixes: 170b735820ac "DANE support for X509_verify_cert()"
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar  5 12:37:17 2026
(Merged from https://github.com/openssl/openssl/pull/30250)

(cherry picked from commit 8b5cd6a682f0f6e7b8bf55137137c567d1899c4a)

2 months agoMake the openssl-ciphers(1) manual page up to date
Igor Ustinov [Wed, 25 Feb 2026 14:13:54 +0000 (15:13 +0100)] 
Make the openssl-ciphers(1) manual page up to date

There are multiple changes - updated ciphers to more current ones,
also better documentation for COMPLEMENTOFDEFAULT.

Fixes #6653

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Mar  4 09:57:02 2026
(Merged from https://github.com/openssl/openssl/pull/30178)

2 months agoSSL_get_shared_ciphers(): Return NUL-terminated buffer for no shared ciphers
Frederik Wedel-Heinen [Sat, 11 Oct 2025 05:23:50 +0000 (07:23 +0200)] 
SSL_get_shared_ciphers(): Return NUL-terminated buffer for no shared ciphers

Also validate the input buffer and length properly.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Mar  4 09:30:18 2026
(Merged from https://github.com/openssl/openssl/pull/28859)

(cherry picked from commit 51b0bd6097e57cf4ff863c272b611dedc4ecf8d0)