]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
7 hours agoaes_core.c: Fix staircase formatting issue master
Norbert Pocs [Thu, 11 Jun 2026 08:27:52 +0000 (10:27 +0200)] 
aes_core.c: Fix staircase formatting issue

Continuation of https://github.com/openssl/openssl/pull/31350

Fixes: https://github.com/openssl/openssl/issues/31348
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
MergeDate: Fri Jun 12 19:25:02 2026
(Merged from https://github.com/openssl/openssl/pull/31446)

13 hours agotest: add Windows RIO notifier smoke test
Mounir IDRASSI [Sat, 18 Apr 2026 05:21:49 +0000 (14:21 +0900)] 
test: add Windows RIO notifier smoke test

Add a Windows-only RIO notifier test that exercises initialization,
signalling, unsignalling, and cleanup without test-only hooks.

The RIO WSA lifecycle fix itself landed via #31339. This keeps the
remaining PR focused on coverage and removes the stale ssl_init.c include
for the deleted WSA cleanup path.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Fri Jun 12 13:54:17 2026
(Merged from https://github.com/openssl/openssl/pull/30918)

13 hours agocrypto/ec/curve448/eddsa.c: make dom_s constant static in hash_init_with_dom()
Eugene Syromiatnikov [Wed, 3 Jun 2026 07:34:55 +0000 (09:34 +0200)] 
crypto/ec/curve448/eddsa.c: make dom_s constant static in hash_init_with_dom()

Otherwise it is allocated on stack and initialised on each call.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Jun 12 13:11:50 2026
(Merged from https://github.com/openssl/openssl/pull/31362)

13 hours agocurve448: make locally-used functions static and remove unused ones
Eugene Syromiatnikov [Tue, 2 Jun 2026 10:51:45 +0000 (12:51 +0200)] 
curve448: make locally-used functions static and remove unused ones

ossl_c448_ed448_derive_public_key(), ossl_c448_ed448_sign(),
and ossl_c448_ed448_verify() are only called from within the compilation
unit, while ossl_c448_ed448_convert_private_key_to_x448(),
ossl_c448_ed448_sign_prehash() and ossl_c448_ed448_verify_prehash()
are not used anywhere, seemingly.  Make the former static (removing
them from the header, removing the ossl_ prefix, and moving
the descriptions to the definitions) and remove the latter.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Jun 12 13:11:48 2026
(Merged from https://github.com/openssl/openssl/pull/31362)

34 hours agoRevert "Add indirect CRL path validation tests"
Bob Beck [Thu, 11 Jun 2026 16:50:34 +0000 (10:50 -0600)] 
Revert "Add indirect CRL path validation tests"

This reverts commit 35c1d7b16d5853a10d290cdbde0a997b1e5abee7.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Thu Jun 11 17:27:42 2026
(Merged from https://github.com/openssl/openssl/pull/31459)

34 hours agoci: Verify jom/NASM downloads and fall back to upstream on forks
Dmitry Misharov [Wed, 3 Jun 2026 11:12:36 +0000 (13:12 +0200)] 
ci: Verify jom/NASM downloads and fall back to upstream on forks

Move the OpenSSL-hosted jom and NASM downloads under the /ci-deps/
path and verify them against SHA256 sums recorded in
.github/ci-deps.json before installing. Forks, which can't reach the
mirror reliably, download from the upstream Qt and NASM locations
instead.

Affected workflows: windows.yml, windows_comp.yml, os-zoo.yml

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Thu Jun 11 16:17:03 2026
(Merged from https://github.com/openssl/openssl/pull/30957)

34 hours agoci: Download jom and NASM from OpenSSL-hosted mirror
Dmitry Misharov [Fri, 24 Apr 2026 07:47:57 +0000 (09:47 +0200)] 
ci: Download jom and NASM from OpenSSL-hosted mirror

Chocolatey-hosted packages for jom and NASM occasionally become
unavailable, causing CI failures on Windows builds. Host these
tools on our own infrastructure to eliminate this external
dependency.

Affected workflows: windows.yml, windows_comp.yml, os-zoo.yml

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Thu Jun 11 16:17:01 2026
(Merged from https://github.com/openssl/openssl/pull/30957)

34 hours agoAdd constant-time validation for CRYPTO_memcmp
David Foster [Fri, 5 Jun 2026 02:02:44 +0000 (22:02 -0400)] 
Add constant-time validation for CRYPTO_memcmp

Add test/crypto_memcmp_test.c which provides functional coverage for
CRYPTO_memcmp under regular builds and constant-time coverage under
enable-ct-validation builds.

The added constant-time coverage checks:
- there are no data dependent branches or memory accesses,
  on x86_64 and aarch64 architectures

The added constant-time coverage does NOT check:
- there are no data-dependent variable-time instructions, such as
  instructions NOT on the x86 Data Operand Independent Timing list
  or NOT on the ARM Data-Independent Timing list
- any architectures beyond x86_64 and aarch64

New CONSTTIME_SECRET annotations live only in the test rather than in
the generic C version of CRYPTO_memcmp so that both the C and
assembler versions of CRYPTO_memcmp are constant-time covered.

CRYPTO_memcmp directly backs CPython's secrets.compare_digest() and
hmac.compare_digest(), so a timing leak in it is high impact, yet it had
essentially no direct test coverage.

References #15076.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
MergeDate: Thu Jun 11 16:11:58 2026
(Merged from https://github.com/openssl/openssl/pull/31398)

34 hours agoFix up mismatched error reason codes
Jon Spillett [Thu, 4 Jun 2026 20:23:07 +0000 (06:23 +1000)] 
Fix up mismatched error reason codes

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:06:41 2026
(Merged from https://github.com/openssl/openssl/pull/31390)

34 hours agoFIPS: Make keygen PCT failures recoverable
slontis [Tue, 2 Jun 2026 01:21:54 +0000 (11:21 +1000)] 
FIPS: Make keygen PCT failures recoverable

Key generation pairwise consistency tests (PCT) no longer cause the
FIPS provider to enter a non recoverable error state.

Originally I considered that the pairwise tests should never fail, so a
failure was considered as a fatal error. Unfortunately this is not true,
since the RSA pairwise test was changed to call
rsa_ossl_public_encrypt(). This function can return -1 based on the
values of n and e, resulting in a DOS for bad inputs.
Under NIST FIPS 186-5, the public exponent (e) must be an odd positive
integer greater than (e > 65536) and less than 2^256. The OpenSSL code
however returns an error if e > 2^64 when n > 3072.
(This check was added to prevent a CVE DOS).

While FIPS 140-3 mandates that a module must transition into an error
state upon self-test failures, a PCT is classified as a conditional
self-test, not a pre-operational self-test
(like an integrity test or a Known Answer Test)
The cryptographic module is only required to immediately discard the
faulty key pair and output a local error. The module is allowed to
immediately attempt generating a new key pair using fresh entropy,
without needing a full system reboot or module reset.

Detected by Oracle during Jipher testing.

Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Jun 11 16:03:42 2026
(Merged from https://github.com/openssl/openssl/pull/31359)

35 hours agorsa: add pkcs1 and oaep mfail tests
Jakub Zelenka [Mon, 1 Jun 2026 21:42:07 +0000 (23:42 +0200)] 
rsa: add pkcs1 and oaep mfail tests

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:17 2026
(Merged from https://github.com/openssl/openssl/pull/31356)

35 hours agoevp: add test_set_get_raw_keys_mfail to evp extra tests
Jakub Zelenka [Mon, 1 Jun 2026 21:28:57 +0000 (23:28 +0200)] 
evp: add test_set_get_raw_keys_mfail to evp extra tests

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:16 2026
(Merged from https://github.com/openssl/openssl/pull/31356)

35 hours agomfail: add hard failure return code for failing even for NO_CHECK
Jakub Zelenka [Mon, 8 Jun 2026 14:45:57 +0000 (16:45 +0200)] 
mfail: add hard failure return code for failing even for NO_CHECK

The hard failure return code is meant for NO_CHECK variants to fail if
there is some failure that should never happen and likely signal a bug.

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:15 2026
(Merged from https://github.com/openssl/openssl/pull/31356)

35 hours agomfail: do not count allocations for no file when checked
Jakub Zelenka [Mon, 1 Jun 2026 21:27:55 +0000 (23:27 +0200)] 
mfail: do not count allocations for no file when checked

This skips some debug and error allocations that cannot be handled

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:14 2026
(Merged from https://github.com/openssl/openssl/pull/31356)

35 hours agomfail: add all tests iterable variants
Jakub Zelenka [Mon, 1 Jun 2026 18:04:37 +0000 (20:04 +0200)] 
mfail: add all tests iterable variants

It adds ADD_MFAIL_ALL_TESTS and ADD_MFAIL_ALL_NO_CHECK_TESTS that work
in similar way as ADD_ALL_TESTS but with mfail testing.

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 16:00:12 2026
(Merged from https://github.com/openssl/openssl/pull/31356)

35 hours agoAdd indirect CRL path validation tests
Jakub Zelenka [Tue, 19 May 2026 17:24:33 +0000 (19:24 +0200)] 
Add indirect CRL path validation tests

This covers currently uncovered check_crl_path and check_crl_chain
in x509_vfy.c. The mfail test tests the happy path and all memory
failures in it. In addition 3 error scenarios are tested.

Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 15:58:37 2026
(Merged from https://github.com/openssl/openssl/pull/31244)

35 hours agoAdd apps test for external PSK callbacks
Jakub Zelenka [Fri, 15 May 2026 11:00:38 +0000 (13:00 +0200)] 
Add apps test for external PSK callbacks

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 15:52:36 2026
(Merged from https://github.com/openssl/openssl/pull/31190)

35 hours agoMove common macro definitions to internal/common.h and fix comments.
Frederik Wedel-Heinen [Sun, 15 Feb 2026 14:04:36 +0000 (15:04 +0100)] 
Move common macro definitions to internal/common.h and fix comments.

Fixes #2480

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Jun 11 15:51:32 2026
(Merged from https://github.com/openssl/openssl/pull/30019)

35 hours agoFix potential NULL dereference in OSSL_CRMF_ENCRYPTEDVALUE_decrypt()
Igor Ustinov [Mon, 11 May 2026 14:29:47 +0000 (16:29 +0200)] 
Fix potential NULL dereference in OSSL_CRMF_ENCRYPTEDVALUE_decrypt()

Check that 'parameter' != NULL before dereferencing in
OSSL_CRMF_ENCRYPTEDVALUE_decrypt().

Fixes CVE-2026-42767

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 20:38:27 2026

35 hours agoTest for CVE-2026-45447 (UAF in PKCS7_verify)
Igor Ustinov [Sat, 16 May 2026 06:22:53 +0000 (08:22 +0200)] 
Test for CVE-2026-45447 (UAF in PKCS7_verify)

The test data were created with a tool developed by
Thai Duong <thai@calif.io>.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 20:22:52 2026

35 hours agoFix possible use-after-free in OpenSSL PKCS7_verify()
Igor Ustinov [Sat, 16 May 2026 06:16:23 +0000 (08:16 +0200)] 
Fix possible use-after-free in OpenSSL PKCS7_verify()

Fixes CVE-2026-45447

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 20:22:50 2026

35 hours agoFix handling of empty-ciphertext messages in AES-GCM-SIV and AES-SIV
Dmitry Belyavskiy [Wed, 13 May 2026 09:45:51 +0000 (11:45 +0200)] 
Fix handling of empty-ciphertext messages in AES-GCM-SIV and AES-SIV

AES-GCM-SIV: EVP_DecryptFinal_ex Accepts All-Zero Tag for Empty-Ciphertext
Messages.

AES-SIV: EVP_DecryptUpdate_ex Accepts All-Zero Tag for Empty-Ciphertext
Messages on context reuse.

Fixes CVE-2026-45446

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 20:12:25 2026

35 hours agoApply the buffered IV on the AES-OCB EVP_Cipher() path
Viktor Dukhovni [Mon, 18 May 2026 08:09:44 +0000 (18:09 +1000)] 
Apply the buffered IV on the AES-OCB EVP_Cipher() path

aes_ocb_cipher(), the OCB provider's OSSL_FUNC_CIPHER_CIPHER slot,
processed input without flushing the buffered IV into the OCB
context.  Effective nonce was 0 regardless of the caller's IV;
EVP_*Final_ex() then emitted a tag depending only on (key, iv).
This gave (key, nonce) reuse and single-query universal forgery on
the EVP_Cipher() path.

Apply update_iv() at the head of aes_ocb_cipher() to mirror the
streaming handler.  The matching GCM one-shot does this already.

Add a cross-driver round-trip test for AES-{GCM,CCM,OCB} and
ChaCha20-Poly1305 in test/evp_extra_test.c.  Each cipher is
exercised with and without AAD; the no-AAD case is needed because
any prior EVP_CipherUpdate(NULL, aad, ...) routes through the
streaming handler and applies the IV itself, masking the bug.

Fixes CVE-2026-45445

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 20:02:00 2026

35 hours agoAdd further unit tests for e-mail validation
Bob Beck [Fri, 17 Apr 2026 18:25:14 +0000 (12:25 -0600)] 
Add further unit tests for e-mail validation

Ensure we correctly catch misformed things.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 19:59:29 2026

35 hours agoFix length miscalculation in validate_email
Bob Beck [Fri, 17 Apr 2026 18:21:16 +0000 (12:21 -0600)] 
Fix length miscalculation in validate_email

We incorrectly used the length of the domain part for the local part
when validating e-mail for X509_VERIFY_PARAM_set1_email().

Fixes CVE-2026-42771

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 19:59:28 2026

35 hours agoMatch the local q DHX parameter against the peer's q
Norbert Pocs [Tue, 12 May 2026 13:16:04 +0000 (15:16 +0200)] 
Match the local q DHX parameter against the peer's q

As FFC/DH peer public key validation uses the peer's q value instead
of checking against the local q, we must also check that these
q values match when setting the peer's public key.

Fixes CVE-2026-42770

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 19:56:27 2026

35 hours agoUse the correct issuer when validating rootCAKeyUpdate
Bob Beck [Fri, 17 Apr 2026 20:09:52 +0000 (14:09 -0600)] 
Use the correct issuer when validating rootCAKeyUpdate

This correctly uses the existing root, and not the same certificate
as the root of the chain to validate.

While we are here, we also turn on self signed certificate signature
checking as this case is actually bringing in trust anchors as
self signed certs, and fix a possible NULL deref.

Fixes CVE-2026-42769

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 19:54:01 2026

35 hours agoEnforce implicit rejection for CMS/PKCS#7 decryption
Dmitry Belyavskiy [Fri, 15 May 2026 12:09:17 +0000 (14:09 +0200)] 
Enforce implicit rejection for CMS/PKCS#7 decryption

Drop the disablement of the implicit rejection for RSA PKCS#1 v1.5
decryption.

Fixes CVE-2026-42768

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Alicja Kario <hkario@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 19:49:19 2026

35 hours agoTest for CVE-2026-42766
Igor Ustinov [Wed, 20 May 2026 18:02:43 +0000 (20:02 +0200)] 
Test for CVE-2026-42766

The script make_missing_kdf_der.py was developed by Mayank Jangid
and Kushal Khemka.

Co-Authored-by: Mayank Jangid <mayank.jangid.moon@gmail.com>
Co-Authored-by: Kushal Khemka <kushalkhemka559@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 18:57:53 2026

35 hours agoFix potential NULL dereference processing CMS PasswordRecipientInfo
Igor Ustinov [Thu, 21 May 2026 06:36:54 +0000 (08:36 +0200)] 
Fix potential NULL dereference processing CMS PasswordRecipientInfo

Avoid NULL dereferencing when keyDerivationAlgorithm is absent
in CMS PasswordRecipientInfo.

Fixes CVE-2026-42766

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 18:57:52 2026

35 hours agoFix NULL Dereference in Certificate Verification with OCSP Checking
Daniel Kubec [Fri, 15 May 2026 23:04:30 +0000 (01:04 +0200)] 
Fix NULL Dereference in Certificate Verification with OCSP Checking

When performing OCSP response checking for certificates in the verification
chain, the code always tries to access the next certificate as the issuer.
There is a check for a self-signed certificate. However with the partial
chain verification enabled when the chain does not have a self-signed trusted
anchor, the issuer will be NULL for the last certificate in the chain. A NULL
pointer dereference then happens.

This issue affects only applications which enable both OCSP verification
of the certificate chain (X509_V_FLAG_OCSP_RESP_CHECK_ALL) and partial
chain verification (X509_V_FLAG_PARTIAL_CHAIN) in the certificate
verification. Both flags are disabled by default. For that reason, we have
assigned Low severity to the issue.

Fixes CVE-2026-42765

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 18:55:29 2026

35 hours agoFix NULL dereference in QUIC address validation
Alexandr Nedvedicky [Tue, 12 May 2026 14:12:40 +0000 (16:12 +0200)] 
Fix NULL dereference in QUIC address validation

QUIC server crashes when address validation (RFC 9000, Section 8.1)
is disabled and client sends initial packet with invalid token.

Issue reported and fix submitted by Sunwoo Lee (KENTECH),
Hyuk Lim (KENTECH) and Seunghyun Yoon (KENTECH)

Fixes CVE-2026-42764

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:50:48 2026

35 hours agoFix Double-free When Checking OCSP Stapled Response
Daniel Kubec [Mon, 18 May 2026 13:01:25 +0000 (15:01 +0200)] 
Fix Double-free When Checking OCSP Stapled Response

If OCSP stapling is enabled and the TLS client connects to a malicious server,
a crafted OCSP stapled response can trigger a double free in the TLS client
when the stapled response is checked.

The OCSP stapling is not enabled by default. Reliable code execution
through a double-free is technically complex and highly environment-dependent
but the Denial of Service impact is straightforward to achieve, warranting
Moderate severity.

Fixes CVE-2026-35188

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:44:58 2026

35 hours agoAdd test for path challenge flood mitigation
Alexandr Nedvedicky [Tue, 21 Apr 2026 12:13:03 +0000 (14:13 +0200)] 
Add test for path challenge flood mitigation

client injects 16 path challenge frames. Those are received
by server. Only one challenge frame of 16 received triggers
path challenge response. Remaining challenge frames are
discrded/ignored.

Test introduces two counters to channel object:
  - path_challenge_rx which is bumped for every patch challenge
  frame received

  - path_response_tx which is bumped for every path response
  frame transmitted

Succesuful test verifies server receives 16 path challenge frames,
but sends just one path response frmae as response.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:35:21 2026

35 hours agoQUIC stack must limit the number of PATH_CHALLENGE frames processed in RX
Alexandr Nedvedicky [Thu, 26 Mar 2026 13:24:32 +0000 (14:24 +0100)] 
QUIC stack must limit the number of PATH_CHALLENGE frames processed in RX

Currently local QUIC stack allocates PATH_RESPONSE frame for every
PATH_CHALLENGE frame it receives in single packet from its remote peer.
The memory with PATH_RESPONSE frame is released after local QUIC stack
receives an ACK which confirms reception of PATH_RESPONSE by remote peer.
This gives remote peer too much control over memory resources local
QUIC stack may consume.

Quoting RFC 9000 section 9.2.1:
...an endpoint SHOULD NOT send multiple
PATH_CHALLENGE frames in a single packet.

Limiting the number of PATCH_CHALLENGE frames to 1 per QUIC packet received
helps to reduce heap memory overhead required to process PATH_CHALLENGE
frame.

Currently QUIC ACKM (ACK-manager) keeps all frames in retransmission
buffer until ACK is received. It can be changed such frames which
don't need to be ACKed don't need to be kept in retrans buffer,
those can be released right after transmission.

Fixes CVE-2026-34183

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:35:20 2026

35 hours agoAdd tests for CVE-2026-34182
Neil Horman [Tue, 5 May 2026 13:16:29 +0000 (09:16 -0400)] 
Add tests for CVE-2026-34182

Test to ensure that for a given CMS message:

1) We do not allow the creation of a CMS message containing
   AuthEnvelopedData with a non-AEAD cipher.
2) We do not accept a message containing AuthEnvelopedData with a
   non-AEAD cipher specified in the AlgorithmIdentifier.
3) We do not allow tag lengths less that 4 bytes.

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:27:03 2026

35 hours agoReject potentially forged encrypted CMS AuthEnvelopedData messages
Neil Horman [Fri, 17 Apr 2026 17:21:50 +0000 (13:21 -0400)] 
Reject potentially forged encrypted CMS AuthEnvelopedData messages

1. Adjust ossl_cms_EncryptedContent_init_bio to not accept non-AEAD
ciphers.

If a forged CMS message with AuthEnvelopedData is received with
a non-AEAD cipher specified, we silently accept that and decrypt
the message, skipping any authentication, which violates RFC 5083.

We also add checks to ensure we fail if we try to encrypt
AuthEnvelopedData without using an AEAD cipher.

2. Ensure that tag lengths on cms AEAD data is the recommended size.

RFC 5084 recommends that mac tags be at least 12 bytes for AES-GCM
and 4 bytes for AES-CCM on AuthEnvelopedData. As this code is not
algorith-specific we add a check for a minimal size and just use the
lower limit which is sufficient to prevent this attack.

Without this check, its possible to set the tag length to 1 and within
256 guesses, forge a CMS message.

Fixes CVE-2026-34182

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:27:02 2026

35 hours agopkcs12: verify that the pbmac1 key length is safe
Alicja Kario [Wed, 29 Apr 2026 14:29:35 +0000 (16:29 +0200)] 
pkcs12: verify that the pbmac1 key length is safe

Short mac keys (as short as 1 byte) can be used to probe the
system under attack to accept a PKCS#12 file created by an attacker
even if the attacker doesn't know the password used for MAC protection.

Fixes CVE-2026-34181

(also update the reference to the PBMAC1 PKCS#12 RFC)

Signed-off-by: Alicja Kario <hkario@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:18:59 2026

35 hours agoAvoid length truncation in ASN1_STRING_set
Viktor Dukhovni [Tue, 7 Apr 2026 12:40:55 +0000 (22:40 +1000)] 
Avoid length truncation in ASN1_STRING_set

The ASN1_STRING_set() function takes an `int` length, make sure the
argument is not inadvertently truncated when it is called from
asn1_ex_c2i().

Fixes CVE-2026-34180

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:13:56 2026

35 hours agocms: kek_unwrap_key: test for fix out-of-bounds read in check-byte validation
Nikola Pajkovsky [Thu, 21 May 2026 12:18:11 +0000 (14:18 +0200)] 
cms: kek_unwrap_key: test for fix out-of-bounds read in check-byte validation

added EnvelopedData blob with a PasswordRecipientInfo using
id-alg-PWRI-KEK and an AES-128-CFB key encryption cipher. CFB's 1-byte
effective block size let the inlen >= 2 * blocklen guard in
kek_unwrap_key() accept a wrapped key shorter than the seven octets
the check-byte test reads from tmp[1..6]; the encryptedKey OCTET
STRING here is only two bytes.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:06:38 2026

35 hours agocms: kek_unwrap_key: Fix out-of-bounds read in check-byte validation
Nikola Pajkovsky [Thu, 21 May 2026 09:53:09 +0000 (11:53 +0200)] 
cms: kek_unwrap_key: Fix out-of-bounds read in check-byte validation

the check-byte test in kek_unwrap_key() reads tmp[1] through tmp[6]
unconditionally, so the decrypted buffer must hold at least seven
octets. The pre-decryption size check enforces inlen >= 2 * blocklen,
which yields the required seven octets only when blocklen >= 4. For
a KEK cipher with a smaller block size, inlen can be as small as
2 * blocklen and the check-byte read overruns the inlen-sized tmp
allocation.

Reject blocklen < 4 in the early sanity check. All block ciphers
appropriate for CMS PasswordRecipientInfo key wrapping have a block
size of at least 8 octets (DES/3DES = 8, AES = 16), so this only
forbids ciphers that would not be valid KEK choices anyway, and the
existing inlen >= 2 * blocklen check then guarantees the seven-octet
lower bound the check-byte test relies on.

Fixes CVE-2026-9076

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 14:06:36 2026

35 hours agoReject oversized inputs in ASN1_mbstring_ncopy()
Viktor Dukhovni [Wed, 29 Apr 2026 08:23:24 +0000 (18:23 +1000)] 
Reject oversized inputs in ASN1_mbstring_ncopy()

In ASN1_mbstring_ncopy() the destination size for BMPSTRING and
UNIVERSALSTRING output was computed by a signed left shift on an
int:

    outlen = nchar << 1;        /* MBSTRING_BMP  */
    outlen = nchar << 2;        /* MBSTRING_UNIV */

For nchar large enough the result is not representable in int.  In
the worst case (nchar == 0x40000000) nchar << 2 wraps to zero,
OPENSSL_malloc(1) is called, and traverse_string() then writes
4*nchar bytes into the one-byte allocation: a heap buffer
overflow.  The MBSTRING_UTF8 path computes outlen by summing
per-character byte counts in out_utf8(), and that sum can overflow
the same int under similarly large inputs.

Neither path is reachable from code that processes X.509
certificates through the DIRSTRING_TYPE mask used by
ASN1_STRING_set_by_NID(): UNIVERSALSTRING is absent from that
mask, and the UTF-8 sum requires inputs on the order of half a
gigabyte.  Reaching them needs an application that calls
ASN1_mbstring_copy()/ASN1_mbstring_ncopy() directly, or registers
a custom NID via ASN1_STRING_TABLE_add(), with an oversized
attacker-controlled input.

Add range checks before each shift and in out_utf8(), raising
ASN1_R_STRING_TOO_LONG at the point of detection.  Move the
existing ASN1_R_INVALID_UTF8STRING raise into out_utf8() too so
the two failure modes report distinct codes; the MBSTRING_UTF8
caller is left with cleanup only and now frees dest on error,
matching the BMP/UNIV branches.

Fixes CVE-2026-7383

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon Jun  8 14:02:18 2026

36 hours agoCMP: Optionally accept missing or non-matching transactionID or recipNonce values
Dr. David von Oheimb [Thu, 3 Apr 2025 06:53:58 +0000 (08:53 +0200)] 
CMP: Optionally accept missing or non-matching transactionID or recipNonce values

This is done for error messages received if OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES
is set or the respective -nonmatched_error_nonces CLI option is given.

Can be helpful when the server (or other peer) cannot provide a proper error message header,
for instance if was unable to parse the ASN.1 encoding of a request message.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 14:56:49 2026
(Merged from https://github.com/openssl/openssl/pull/29043)

36 hours agoadd HISTORY and CHANGES.md entry for OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR...
Dr. David von Oheimb [Tue, 2 Jun 2026 19:44:08 +0000 (21:44 +0200)] 
add HISTORY and CHANGES.md entry for OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR introduced in 4.0

Complements: 21722fe5545c "OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR: use new TA(s) for whole transaction (also pkiconf); update doc"

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 14:56:47 2026
(Merged from https://github.com/openssl/openssl/pull/29043)

36 hours agoOSSL_CMP_CTX_new.pod: fix HISTORY entry for OSSL_CMP_CTX_get0_geninfo_ITAVs() and...
Dr. David von Oheimb [Wed, 3 Jun 2026 06:49:05 +0000 (08:49 +0200)] 
OSSL_CMP_CTX_new.pod: fix HISTORY entry for OSSL_CMP_CTX_get0_geninfo_ITAVs() and OSSL_CMP_OPT_NO_CACHE_EXTRACERTS

Complements 8d9c8b3ff "CMP doc: add missing text on OSSL_CMP_OPT_NO_CACHE_EXTRACERTS to OSSL_CMP_CTX_new.pod and ossl_cmp_msg_check_update.pod"

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Jun 11 14:56:46 2026
(Merged from https://github.com/openssl/openssl/pull/29043)

41 hours agodoc: document SSL_set_*_state SSL argument
Steve Grubb [Tue, 9 Jun 2026 21:35:49 +0000 (17:35 -0400)] 
doc: document SSL_set_*_state SSL argument

SSL_set_connect_state() and SSL_set_accept_state() have no return value to
report argument errors, but their documentation did not state the precondition
for the SSL argument. Passing NULL, or a pointer that is not a valid
SSL object, is a programmer error rather than a recoverable API error.
Document that the ssl argument must point to a valid SSL object and
must not be NULL.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Thu Jun 11 09:04:23 2026
(Merged from https://github.com/openssl/openssl/pull/31435)

41 hours agodoc: document deprecated engine configure options
kovan [Thu, 29 Jan 2026 11:17:38 +0000 (12:17 +0100)] 
doc: document deprecated engine configure options

Document that no-engine, no-static-engine, and no-dynamic-engine
configure options are deprecated and do nothing. These options are
retained for backwards compatibility only.

Fixes #27473

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Thu Jun 11 09:02:08 2026
(Merged from https://github.com/openssl/openssl/pull/29839)

42 hours agouni2utf8: reject negative length like uni2asc
rootvector2 [Wed, 3 Jun 2026 18:28:39 +0000 (23:58 +0530)] 
uni2utf8: reject negative length like uni2asc

Reviewed-by: Alicja Kario <hkario@redhat.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Jun 11 08:56:39 2026
(Merged from https://github.com/openssl/openssl/pull/31378)

42 hours agox509: check inner/outer signatureAlgorithm match in X509_CRL_verify
Viktor Dukhovni [Mon, 18 May 2026 10:41:54 +0000 (20:41 +1000)] 
x509: check inner/outer signatureAlgorithm match in X509_CRL_verify

RFC 5280 section 5.1.1.2 requires the signatureAlgorithm in the outer
CertificateList wrapper to be identical to the signature field inside
the signed TBSCertList.  def_crl_verify() did not enforce this, unlike
X509_verify() and X509_ACERT_verify() which both carry an X509_ALGOR_cmp
guard.

Add the same guard to def_crl_verify().  A mismatch raises
X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH.  No known attack results from
the missing check; this is a conformance and hardening fix only.

Add a regression test: a CRL with a valid RSA-SHA256 signature over a
TBSCertList whose inner signatureAlgorithm claims ecdsaWithSHA256 is
now rejected.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Jun 11 08:45:41 2026
(Merged from https://github.com/openssl/openssl/pull/31213)

2 days agoconvert CRYPTO_THREAD_run_once to use InitOnceExecuteOnce api
Neil Horman [Fri, 29 May 2026 13:59:21 +0000 (09:59 -0400)] 
convert CRYPTO_THREAD_run_once to use InitOnceExecuteOnce api

Issue #22059 reported a race condition in CRYPTO_THREAD_run_once on
windows platforms.  The most correct fix for this is to convert the
windows run_once implementation to use the Win32 InitOnceRunOnce
interface.  Doing so requires at least Windows Vista/Windows Server 2008
to be available, and because WinXP hasn't built since 3.0 released, it
seems sensible to bump our minimal NT version to be 0x600 (Vista/2008)

Also, while we're at it, this change caught a bad programming practice
in the rio_notifier code, which attempts to reset the once variable
during shutdown.  The windows static initalizer macro for this api is
constructed such that attempting to do so causes a build break.  Since
once variables are not meant to be reset (since they are only triggered
once), remove that reset code to avoid the breakage.

Note that this problem was independently found and fixed in #30198.
We're taking the fix from this pr (as they are effectively identical),
and using that PR to add some much needed tests to the rio code.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Bob Beck <beck@openssl.org>
MergeDate: Wed Jun 10 19:44:19 2026
(Merged from https://github.com/openssl/openssl/pull/31339)

2 days agoFix parentheses in bn_cp_64 macro
Norbert Pocs [Fri, 5 Jun 2026 10:19:56 +0000 (12:19 +0200)] 
Fix parentheses in bn_cp_64 macro

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 13:24:46 2026
(Merged from https://github.com/openssl/openssl/pull/31386)

2 days agoFix macro staircase formatting issue
Norbert Pocs [Thu, 4 Jun 2026 13:30:32 +0000 (15:30 +0200)] 
Fix macro staircase formatting issue

When the macro contains a comma (',') as a trailer character, then
clang-format doesn't get the correct formatting

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 13:24:44 2026
(Merged from https://github.com/openssl/openssl/pull/31386)

2 days agobuild: make enable-asan work for VC targets
Jakub Zelenka [Tue, 2 Jun 2026 15:09:09 +0000 (17:09 +0200)] 
build: make enable-asan work for VC targets

Configure assumed GCC/Clang sanitizer spellings, so enable-asan was a
no-op on MSVC. Emit /fsanitize=address instead of -fsanitize=address
on VC targets.

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 12:53:11 2026
(Merged from https://github.com/openssl/openssl/pull/31366)

2 days agoConsistenly zeroize public parameters based on OPENSSL_PEDANTIC_ZEROIZATION
Eugene Syromiatnikov [Tue, 12 May 2026 12:14:00 +0000 (14:14 +0200)] 
Consistenly zeroize public parameters based on OPENSSL_PEDANTIC_ZEROIZATION

Commit fa338aa7cd1e "fips: zeroization of public security parameters (PSPs)"[1]
introduced zeroization of public security params, which then[2] switched
its usage to OPENSSL_PEDANTIC_ZEROIZATION; however, zeroization has
implemented inconsistently, leaving out public security parameter
updates.  Consistently use newly introduced wrappers,
ossl_public_bn_free and ossl_public_param_free, for freeing such
parameters, and use them for FFC and RSA.

[1] https://github.com/openssl/openssl/pull/24355
[2] https://github.com/openssl/openssl/pull/26068

Complements: fa338aa7cd1e "fips: zeroization of public security parameters (PSPs)"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Wed Jun 10 12:52:14 2026
(Merged from https://github.com/openssl/openssl/pull/31157)

2 days agoRemove crypto/aes/aes_x86core.c because it's dead code
Andrew Dinh [Tue, 9 Jun 2026 10:11:49 +0000 (17:11 +0700)] 
Remove crypto/aes/aes_x86core.c because it's dead code

Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed Jun 10 12:43:39 2026
(Merged from https://github.com/openssl/openssl/pull/31424)

2 days agoLet's attempt to make real documentation for X509_verify_cert
Bob Beck [Wed, 27 May 2026 14:41:53 +0000 (08:41 -0600)] 
Let's attempt to make real documentation for X509_verify_cert

I am doing this because I have need to add information that really does
belong here, and the current stuff is less documentation than more or
less some hand waving about how it works without any details

So to summarize the changes:

1) This documents the current way that X509_verify_cert goes about
building and verifying a chain, identifying the relevant flags that
can affect how this happens today, and cross references the correct page
to find the rest of the exhaustive list of verification flags and what they do.

2) This documents the verification callback and how it can be used
to affect the verification outcome, This includes warning potential
users of the callback of what returning values from it means,
the common ways to end up unintentionaly doing things you did not expect
with the callback, and that it depends upon internals and should not be
relied upon.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed Jun 10 11:33:13 2026
(Merged from https://github.com/openssl/openssl/pull/31314)

2 days agoquic: Add MFAIL coverage for stream map allocation and token caching
Nikolas Gauder [Sat, 30 May 2026 10:19:22 +0000 (12:19 +0200)] 
quic: Add MFAIL coverage for stream map allocation and token caching

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed Jun 10 11:23:38 2026
(Merged from https://github.com/openssl/openssl/pull/31333)

2 days agoquic: add lhash insert error checks
Nikolas Gauder [Fri, 29 May 2026 12:56:39 +0000 (14:56 +0200)] 
quic: add lhash insert error checks

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed Jun 10 11:23:37 2026
(Merged from https://github.com/openssl/openssl/pull/31333)

2 days agocrypto/evp: align exchange.c cleanup with kem/sig/asymcipher pattern
sucloudflare [Sat, 6 Jun 2026 20:40:23 +0000 (17:40 -0300)] 
crypto/evp: align exchange.c cleanup with kem/sig/asymcipher pattern

Commit a21f77d added explicit null assignments after EVP_KEYMGMT_free()
calls at the err:, legacy:, and success exit paths in kem.c,
asymcipher.c and signature.c.

The identical exit paths in evp_keyexch_init() (crypto/evp/exchange.c)
were not updated at the same time, leaving exchange.c as the only
outlier in the family without these null assignments.

This patch brings exchange.c into consistency with its sibling files
by adding exchange = NULL and tmp_keymgmt = NULL after each free at
the exit paths, matching the established pattern from a21f77d.

No functional change intended.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed Jun 10 11:20:19 2026
(Merged from https://github.com/openssl/openssl/pull/31394)

2 days agodoc: document OSSL_PKEY_PARAM_BITS meaning for each key type
kovan [Tue, 27 Jan 2026 10:32:12 +0000 (11:32 +0100)] 
doc: document OSSL_PKEY_PARAM_BITS meaning for each key type

The EVP_PKEY_get_bits() documentation states that "the definition
of cryptographic length is specific to the key cryptosystem" but
doesn't explain what this means for each key type.

Add a detailed list explaining what "bits" represents for RSA, DSA,
DH, EC, X25519, X448, Ed25519, Ed448, ML-DSA, SLH-DSA, and ML-KEM
key types to help users understand the return value.

Fixes #28337

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed Jun 10 11:15:17 2026
(Merged from https://github.com/openssl/openssl/pull/29790)

2 days agopvkfmt: check keylen before copying the BLOBHEADER
rootvector2 [Mon, 1 Jun 2026 14:28:09 +0000 (19:58 +0530)] 
pvkfmt: check keylen before copying the BLOBHEADER

Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed Jun 10 11:12:39 2026
(Merged from https://github.com/openssl/openssl/pull/31352)

2 days agoVectorize (inverse) NTT in ML-DSA
Timo Keller [Mon, 16 Mar 2026 06:18:26 +0000 (07:18 +0100)] 
Vectorize (inverse) NTT in ML-DSA

The vectorization is implemented using vector extensions (of gcc/clang)
and will work on any architecture with 128 bit vector registers that has
the builtin `vec_mulh` for the high part of a multiplication.

Enable this for s390x.

The speed-up factor on z17 is around 2--3.4.

Signed-off-by: Timo Keller <tkeller@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 09:25:58 2026
(Merged from https://github.com/openssl/openssl/pull/30812)

2 days agoghash-armv4.pl: add missing alignment for gcm_gmult_4bit
Nikola Pajkovsky [Fri, 29 May 2026 07:38:33 +0000 (09:38 +0200)] 
ghash-armv4.pl: add missing alignment for gcm_gmult_4bit

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 07:51:21 2026
(Merged from https://github.com/openssl/openssl/pull/31327)

2 days agosha512-armv4: add missing function alignment
Nikola Pajkovsky [Thu, 28 May 2026 11:29:00 +0000 (13:29 +0200)] 
sha512-armv4: add missing function alignment

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 07:51:20 2026
(Merged from https://github.com/openssl/openssl/pull/31327)

2 days agoarmv4cpuid.pl: add missing function alignment
Nikola Pajkovsky [Thu, 28 May 2026 11:18:41 +0000 (13:18 +0200)] 
armv4cpuid.pl: add missing function alignment

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 07:51:19 2026
(Merged from https://github.com/openssl/openssl/pull/31327)

2 days agoaes-sha1-armv8.pl: add missing function alignment
Nikola Pajkovsky [Thu, 28 May 2026 11:15:49 +0000 (13:15 +0200)] 
aes-sha1-armv8.pl: add missing function alignment

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun 10 07:51:17 2026
(Merged from https://github.com/openssl/openssl/pull/31327)

2 days agocmp_client_test.c: fix partly too generous total_timeout limit for IR session with...
Dr. David von Oheimb [Thu, 7 May 2026 19:43:15 +0000 (21:43 +0200)] 
cmp_client_test.c: fix partly too generous total_timeout limit for IR session with polling

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed Jun 10 06:46:36 2026
(Merged from https://github.com/openssl/openssl/pull/31111)

2 days agocmp_vfy.c: prevent needless and confusing duplication of diagnostic output on failure...
Dr. David von Oheimb [Thu, 23 Oct 2025 19:27:43 +0000 (21:27 +0200)] 
cmp_vfy.c: prevent needless and confusing duplication of diagnostic output on failure validating CMP messages

Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from https://github.com/openssl/openssl/pull/28986)

2 days agocmp_vfy.c: small fixes on content and layout of diagnostics on failure validating...
Dr. David von Oheimb [Thu, 23 Oct 2025 19:26:51 +0000 (21:26 +0200)] 
cmp_vfy.c: small fixes on content and layout of diagnostics on failure validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from https://github.com/openssl/openssl/pull/28986)

2 days agomake sure BIO_set_ssl() transfers ownership of ssl only on success; document this
Dr. David von Oheimb [Thu, 4 Jun 2026 04:48:24 +0000 (06:48 +0200)] 
make sure BIO_set_ssl() transfers ownership of ssl only on success; document this

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:27:04 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

2 days agohttp_lib.c: add check that host_end is not past authority_end
Dr. David von Oheimb [Wed, 8 Apr 2026 06:27:35 +0000 (08:27 +0200)] 
http_lib.c: add check that host_end is not past authority_end

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:27:03 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

2 days agoOSSL_HTTP_REQ_CTX.pod: tweak description of 'expect_asn1' parameter of OSSL_HTTP_REQ_...
Dr. David von Oheimb [Tue, 28 Jun 2022 15:23:45 +0000 (17:23 +0200)] 
OSSL_HTTP_REQ_CTX.pod: tweak description of 'expect_asn1' parameter of OSSL_HTTP_REQ_CTX_set_expected()

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:27:02 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

2 days agoapps/cmp.c: fix use of SSL_set_tlsext_host_name() for SNI and X509_VERIFY_PARAM_set1_...
Dr. David von Oheimb [Fri, 11 Apr 2025 18:19:46 +0000 (20:19 +0200)] 
apps/cmp.c: fix use of SSL_set_tlsext_host_name() for SNI and X509_VERIFY_PARAM_set1_host()

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:27:00 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

2 days agohttp_lib.c: fix parsing 'scheme' part in OSSL_parse_url()
Dr. David von Oheimb [Thu, 31 Jul 2025 15:13:58 +0000 (17:13 +0200)] 
http_lib.c: fix parsing 'scheme' part in OSSL_parse_url()

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:26:59 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

2 days agoSSL_CTX_set_tlsext_servername_callback.pod: improve doc of SSL_set_tlsext_host_name...
Dr. David von Oheimb [Fri, 11 Apr 2025 17:53:00 +0000 (19:53 +0200)] 
SSL_CTX_set_tlsext_servername_callback.pod: improve doc of SSL_set_tlsext_host_name(); update format

Add recommendation to use it for TLS clients, together with X509_VERIFY_PARAM_{set1,add1}_host()

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:26:57 2026
(Merged from https://github.com/openssl/openssl/pull/27357)

3 days agoDisable tls test in pkcs11 provider
Neil Horman [Tue, 5 May 2026 20:53:49 +0000 (16:53 -0400)] 
Disable tls test in pkcs11 provider

The head of the tree is broken due to a combined inability for openssl
and the provider to allow for duplication of MD contexts on an in flight
session

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:32 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoupdate pkcs11 submodule
Neil Horman [Sun, 3 May 2026 22:06:54 +0000 (18:06 -0400)] 
update pkcs11 submodule

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:30 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoclean up the code a bit
Neil Horman [Thu, 30 Apr 2026 20:22:46 +0000 (16:22 -0400)] 
clean up the code a bit

Remove some vestigual code from the property cache and name things
appropriately

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:28 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoOpportunistiaclly move archived items to a separate list
Neil Horman [Thu, 30 Apr 2026 18:01:37 +0000 (14:01 -0400)] 
Opportunistiaclly move archived items to a separate list

if a provider is unloaded and reloaded to a context, all its algorithms
get archived, making them un-look-up-able.  While this is good, having
all those effectively dead entries in the list slows down the linear
traversal in the lookup path, so periodically, while we have the write
lock held, migrate those entries to a separate archive list so that they
don't imact the normal hot path.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:26 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoFix caching of EVP methods when NO_CACHED_FETCH is asserted
Neil Horman [Thu, 30 Apr 2026 14:25:45 +0000 (10:25 -0400)] 
Fix caching of EVP methods when NO_CACHED_FETCH is asserted

noticed during the debugging of this that, even though we may have
no-cached-fetch configured, we still put things in the method store,
which is wrong.

Don't cache things when we say we're not caching things

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:24 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agocorrect property_test
Neil Horman [Wed, 29 Apr 2026 23:07:11 +0000 (19:07 -0400)] 
correct property_test

The duplicate property test has to change because we now archive QUERYs
instead of removing them immediately (i.e. we don't drop the ref count
until the store is freed).

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:21 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoFix persniketyness in tsan
Neil Horman [Wed, 29 Apr 2026 22:39:08 +0000 (18:39 -0400)] 
Fix persniketyness in tsan

TSAN seems to be having a problem with atomic_load_ptr and
atomic_store_ptr.  Both are, by default, __ATOMIC_RELAXED operations.

According to the tsan docs, it flags these operations as a race because,
while they are indivisible, they create no happens-before constraint,
meaning they can be reordered.

An exemplar race that is reported is:

WARNING: ThreadSanitizer: data race (pid=2139404)
  Read of size 4 at 0x723400002308 by thread T39:
    #0 EVP_MD_up_ref crypto/evp/digest.c:995 (threadstest+0x45032d) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #1 evp_md_up_ref crypto/evp/digest.c:974 (threadstest+0x450242) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #2 ossl_method_up_ref crypto/property/property.c:201 (threadstest+0x4b7a55) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #3 ossl_method_store_cache_get_locked crypto/property/property.c:941 (threadstest+0x4b9922) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #4 ossl_method_store_cache_get crypto/property/property.c:974 (threadstest+0x4b9a47) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #5 inner_evp_generic_fetch crypto/evp/evp_fetch.c:314 (threadstest+0x458186) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #6 evp_generic_fetch crypto/evp/evp_fetch.c:404 (threadstest+0x4586dc) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #7 EVP_MD_fetch crypto/evp/digest.c:985 (threadstest+0x4502d7) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #8 derive_kdk crypto/rsa/rsa_ossl.c:472 (threadstest+0x4cf738) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #9 rsa_ossl_private_decrypt crypto/rsa/rsa_ossl.c:646 (threadstest+0x4d0174) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #10 RSA_private_decrypt crypto/rsa/rsa_crpt.c:48 (threadstest+0x4c6971) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #11 rsa_decrypt providers/implementations/asymciphers/rsa_enc.c:321 (threadstest+0x51cab7) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #12 EVP_PKEY_decrypt crypto/evp/asymcipher.c:280 (threadstest+0x44a9ca) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #13 thread_shared_evp_pkey test/threadstest.c:966 (threadstest+0x404be7) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #14 thread_run test/threadstest.h:67 (threadstest+0x40132d) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)

  Previous write of size 8 at 0x723400002308 by main thread (mutexes: write M0):
    #0 memset <null> (libtsan.so.2+0x4c1eb) (BuildId: 40906101a3a1e1f1ececafafda314aee009d688a)
    #1 CRYPTO_zalloc crypto/mem.c:228 (threadstest+0x48679d) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #2 evp_md_new crypto/evp/digest.c:758 (threadstest+0x44f35e) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #3 evp_md_from_algorithm crypto/evp/digest.c:839 (threadstest+0x44f885) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #4 construct_evp_method crypto/evp/evp_fetch.c:230 (threadstest+0x457ec9) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #5 ossl_method_construct_this crypto/core_fetch.c:110 (threadstest+0x4801bf) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #6 algorithm_do_map crypto/core_algorithm.c:77 (threadstest+0x47f7a3) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #7 algorithm_do_this crypto/core_algorithm.c:122 (threadstest+0x47f987) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #8 ossl_provider_doall_activated crypto/provider_core.c:1609 (threadstest+0x49a42a) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #9 ossl_algorithm_do_all crypto/core_algorithm.c:164 (threadstest+0x47fb14) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #10 ossl_method_construct crypto/core_fetch.c:157 (threadstest+0x4803d0) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #11 inner_evp_generic_fetch crypto/evp/evp_fetch.c:333 (threadstest+0x4583a2) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #12 evp_generic_fetch crypto/evp/evp_fetch.c:404 (threadstest+0x4586dc) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #13 EVP_MD_fetch crypto/evp/digest.c:985 (threadstest+0x4502d7) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #14 derive_kdk crypto/rsa/rsa_ossl.c:472 (threadstest+0x4cf738) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #15 rsa_ossl_private_decrypt crypto/rsa/rsa_ossl.c:646 (threadstest+0x4d0174) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #16 RSA_private_decrypt crypto/rsa/rsa_crpt.c:48 (threadstest+0x4c6971) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #17 rsa_decrypt providers/implementations/asymciphers/rsa_enc.c:321 (threadstest+0x51cab7) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)
    #18 EVP_PKEY_decrypt crypto/evp/asymcipher.c:280 (threadstest+0x44a9ca) (BuildId: f34377d95e3c1d13ab9aa3204d2f1f7840d1c84a)

What tsan is saying here is that the memset in evp_md_new may get
re-ordered such that the contents of the EVP_MD may still be getting
zeroed at the time we have (a) found the EVP_MD in the method store
cache, and (b) attempted to do an up_ref on it.

This is plainly impossible, especially given that, in order to reach the
method store cache, it must be places in the method store algorithm
sparse array, which still requires the taking of the method store write
lock.  But for some reason tsan fails to see the memory fence that
creates.

It seems the simplest solution to correct this is, if we are running
under tsan, use __ATOMIC_ACQUIRE and __ATOMIC_RELEASE on
CRYPTO_atomic_[load|store]_ptr to make sure tsan sees the proper memory
ordering.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:19 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoimprove sharding of cache_lists
Neil Horman [Wed, 29 Apr 2026 22:32:01 +0000 (18:32 -0400)] 
improve sharding of cache_lists

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:17 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoclean out lru list and write lock
Neil Horman [Wed, 29 Apr 2026 20:46:42 +0000 (16:46 -0400)] 
clean out lru list and write lock

We don't need either anymore

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:14 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoremove read lock from method store cache lookup
Neil Horman [Tue, 28 Apr 2026 21:08:43 +0000 (17:08 -0400)] 
remove read lock from method store cache lookup

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:12 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agofully replace hash table with linked list
Neil Horman [Tue, 28 Apr 2026 18:01:04 +0000 (14:01 -0400)] 
fully replace hash table with linked list

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:10 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoadd atomic list removal to property cache
Neil Horman [Tue, 28 Apr 2026 15:39:34 +0000 (11:39 -0400)] 
add atomic list removal to property cache

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:08 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoAdd atomic list inserted to method store cache
Neil Horman [Tue, 28 Apr 2026 14:08:24 +0000 (10:08 -0400)] 
Add atomic list inserted to method store cache

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:05 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoremove ossl_method_store cache culling
Neil Horman [Tue, 28 Apr 2026 13:41:17 +0000 (09:41 -0400)] 
remove ossl_method_store cache culling

Theres no point in thrashing the cache like this, it just gives us more
opportunities to dirty the cpu cache by taking the write lock

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 18:17:03 2026
(Merged from https://github.com/openssl/openssl/pull/31018)

3 days agoFix missing dependency on ml_kem_keymgmt.c
Neil Horman [Thu, 4 Jun 2026 13:29:31 +0000 (09:29 -0400)] 
Fix missing dependency on ml_kem_keymgmt.c

ml_kem_keymgmt.c includes der_wrap.h, which is a generated file, but
doesn't include a depdency in its build.info file, meaning that if the
dependencies aren't run in the right order, ml_kem_keymgmt.c gets
compiled before der_wrap.h is generated, leading to a build break.

Fix it by including the needed dependency.

Fixes #31379

Reviewed-by: Alicja Kario <hkario@redhat.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue Jun  9 17:49:28 2026
(Merged from https://github.com/openssl/openssl/pull/31385)

3 days agoProvide independent lock failure signal on cmp_exch_ptr
Neil Horman [Thu, 28 May 2026 08:46:10 +0000 (04:46 -0400)] 
Provide independent lock failure signal on cmp_exch_ptr

Our CRYPTO atomic api has a somewhat consistent problem in that its
possible in the case where locking fails to return an error while the
actual operation (store_int, store_ptr, etc), actually succeded.
cmp_exch is somewhat special here in that we may really need to know
independently if the function failed due to lock failure and if the
exchange occured (so we can know the output value of *expect).  Add a
separate parameter to allow callers to be informed of these statuses
independently.

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Jun  9 17:46:07 2026
(Merged from https://github.com/openssl/openssl/pull/31319)

4 days agoapps/s_client.c: read one byte less to avoid triggerring overflow protection 31187/head
Eugene Syromiatnikov [Mon, 8 Jun 2026 07:39:31 +0000 (09:39 +0200)] 
apps/s_client.c: read one byte less to avoid triggerring overflow protection

Commit e0e276b50a1e "Fix a one byte buffer overflow in s_client" added
a check for the buffer size before adding a terminating \0, which led
to full reads of BUFSIZZ resulting in session termination.  Avoid that
by requesting one byte less.

Co-Autherd-by: Tomas Mraz <tomas@openssl.foundation>
Resolves: https://github.com/openssl/openssl/issues/30925
Fixes: e0e276b50a1e "Fix a one byte buffer overflow in s_client"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 09:12:53 2026
(Merged from https://github.com/openssl/openssl/pull/31413)

4 days agoquic: cleanse derived IV on setup failure
Minh Vu [Sun, 31 May 2026 18:34:17 +0000 (20:34 +0200)] 
quic: cleanse derived IV on setup failure

el_build_keyslot() derives the QUIC IV before the success path stores
*out_iv_len. If a later step fails, the error cleanup currently uses
*out_iv_len and ends up cleansing zero bytes.

Cleanse the caller buffer using the local iv_len instead so the
derived IV is cleared on all post-derivation failure paths.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Daniel Kubec <kubec@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 08:53:50 2026
(Merged from https://github.com/openssl/openssl/pull/31346)

4 days agoadd fingerprint of the new PGP key
Dmitry Misharov [Mon, 1 Jun 2026 19:24:59 +0000 (21:24 +0200)] 
add fingerprint of the new PGP key

Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 08:27:39 2026
(Merged from https://github.com/openssl/openssl/pull/31353)

4 days agoCheck custom extensions are handled correct with 3rd party QUIC
Matt Caswell [Tue, 19 May 2026 10:24:58 +0000 (11:24 +0100)] 
Check custom extensions are handled correct with 3rd party QUIC

We have some code to handle the case where we have custom 3rd party
extension and 3rd party QUIC. Test that this doesn't cause any problems.

Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 07:51:56 2026
(Merged from https://github.com/openssl/openssl/pull/31238)

4 days agoThere is no need to call custom_ext_copy_old_cb after reallocing dst->meths
Matt Caswell [Tue, 19 May 2026 08:47:18 +0000 (09:47 +0100)] 
There is no need to call custom_ext_copy_old_cb after reallocing dst->meths

In custom_exts_copy_conn we realloc'd the dst->meths buffer, and then
called `custom_ext_copy_old_cb` to transfer ownership of the all style
API wrapper allocations to the newly realloc'd buffer. But this makes
no sense. The buffer is realloc'd, and the old buffer is no longer freed,
so ownership of the old style API wrapper allocations transfer as well.
This is actually a use-after-free (we can no longer access the old buffer
once its been realloc'd), and also causes a leak. We just delete this
code.

Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 07:51:55 2026
(Merged from https://github.com/openssl/openssl/pull/31238)

4 days agoReapply "Preserve connection custom extensions in SSL_set_SSL_CTX()"
Matt Caswell [Tue, 19 May 2026 07:35:47 +0000 (08:35 +0100)] 
Reapply "Preserve connection custom extensions in SSL_set_SSL_CTX()"

This reverts commit 7836b7d5b6a6b27a441c4e4c8564be6b270580c4.

Fixes #31193

Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon Jun  8 07:51:54 2026
(Merged from https://github.com/openssl/openssl/pull/31238)

9 days agoaes_wrap: prevent crash on update without a key
007bsd [Mon, 25 May 2026 21:10:43 +0000 (00:10 +0300)] 
aes_wrap: prevent crash on update without a key

EVP_CipherInit_ex2 with a NULL key followed by EVP_CipherUpdate
on AES-WRAP/WRAP-PAD/WRAP-INV ciphers dereferenced an uninitialised
function pointer because aes_wrap_init installs ctx->block only
when a key is supplied. aes_wrap_cipher_internal had no guard
before dispatching.

Track key state in ctx->key_set, matching OCB/CCM/GCM/Poly1305,
and refuse update if no key has been installed.

Added a regression test covering AES-256-WRAP, AES-256-WRAP-PAD
and AES-256-WRAP-INV.

CLA: trivial

Fixes: ca392b294359 "Add aes_wrap cipher to providers"
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed Jun  3 11:52:05 2026
(Merged from https://github.com/openssl/openssl/pull/31292)

9 days agodoc: Clarify SSL_CERT_DIR uses semicolon separator on Windows
kovan [Mon, 2 Feb 2026 11:01:51 +0000 (12:01 +0100)] 
doc: Clarify SSL_CERT_DIR uses semicolon separator on Windows

The documentation for SSL_CERT_DIR stated that directories are
colon-separated, but on Windows the separator is semicolon.

Updated:
- openssl-rehash.pod.in: Added note about semicolon separator on Windows
- openssl-env.pod: Added note about multiple directories and Windows separator

Fixes: #27698
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Wed Jun  3 11:44:35 2026
(Merged from https://github.com/openssl/openssl/pull/29894)

9 days agoProvide ASN1_STRING_new_not_owned()
Bob Beck [Fri, 24 Apr 2026 20:28:54 +0000 (14:28 -0600)] 
Provide ASN1_STRING_new_not_owned()

This function provides the ability to construct an ASN1_STRING
containing data that is not owned by the constructed ASN1_STRING. The
resulting ASN1_STRING, when freed, will not free the data, and it is
the caller's resposibility to ensure that the data lives past the
lifetime of any returned ASN1_STRING.

Why? you may ask? Many places where ->data and ->length were used
directly in the past before the opaquification of ASN1_STRING were
for this purpose, whether used for actual static data, or to turn
bytes created by and in control of the caller into an ASN1_STRING
for temporary use as an input. This function makes this easier
to do without making copies.

The function deliberately does not allow the creation of a BIT_STRING
as this would require also always providing unused bits, which is
annoying and unnecessary for almost all potential use cases.

For: https://github.com/openssl/openssl/issues/29861
For: https://github.com/openssl/openssl/issues/30162

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Wed Jun  3 11:42:49 2026
(Merged from https://github.com/openssl/openssl/pull/30964)